diff --git a/HACKING b/HACKING index 931e1d66..930d27de 100644 --- a/HACKING +++ b/HACKING @@ -7,6 +7,7 @@ some of the more stylistic-aesthetic rules are clearly visible in current source code, so as long as any new code 'fits in', it should go a long way in satisfying these rules. + ** Coding style For consistency and even more important, to keep things understandable, mu @@ -45,6 +46,26 @@ satisfying these rules. 11. returned strings of type char* must be freed by the caller; if they are not to be freed, 'const char*' should be used instead +** Logging + + For logging, mu uses the GLib logging functions/macros as listed below, + except when logging may not have been initialized. + + The logging system redirects most logging to the log file (typically, + ~/.mu/mu.log). g_warning, g_message and g_critical are shown to the user, + except when running with --quiet, in which case g_message is *not* shown. + + =g_message= are for non-error messages the user will see (unless running with --quiet) + =g_warning= is for problems the user may be able to do something about (and + they are written on stderr) + =g_critical= is for serious, internal problems (g_return_if_fail and + friends use this). (and they are written on stderr) + + don't use g_error + + if you just want to log something in the log file, use MU_LOG_WRITE, as + defined in mu-util.h + #+ Local Variables: *** #+ mode:org ***