|
|
# Log Messages Style
|
|
|
|
|
|
For consistent logging messages, following rules are used:
|
|
|
## Rules for log messages
|
|
|
|
|
|
* message is not terminated by new line
|
|
|
* message is not terminated by dot
|
... | ... | @@ -10,11 +10,18 @@ For consistent logging messages, following rules are used: |
|
|
* full name of unit is used instead of an abbreviation (e.g. `seconds` not `s` or `sec`)
|
|
|
* brief message is better than a whole sentence
|
|
|
* delimit strings *from outside* properly (e.g. use `journal '%s', ...` or `journal, file %s, ...`, not `journal %s ...` for filename inclusion)
|
|
|
* proper category is used
|
|
|
|
|
|
## General rules
|
|
|
|
|
|
* zone name is not included in log message, designated `log_zone_*` function is used instead
|
|
|
* use proper category
|
|
|
* messages should be emitted on *high level*, logging from internal functions should not be done and a proper error code should be used instead
|
|
|
|
|
|
## Logging interface
|
|
|
|
|
|
Logging interface:
|
|
|
Prefer using macros to low-level functions and `log_zone_*` to `log_zone_str_*`.
|
|
|
|
|
|
* server events: log_fatal, log_error, log_warning, log_notice, log_info, log_debug
|
|
|
* zone events (domain name): log_zone_fatal, log_zone_error, log_zone_warning, log_zone_notice, log_zone_info, log_zone_debug
|
|
|
* zone events (ASCII name): log_zone_str_fatal, log_zone_str_error, log_zone_str_warning, log_zone_str_notice, log_zone_str_info, log_zone_str_debug |
|
|
\ No newline at end of file |
|
|
* server events macros: `log_fatal`, `log_error`, `log_warning`, `log_notice`, `log_info`, `log_debug`
|
|
|
* zone events macros (domain name): `log_zone_fatal`, `log_zone_error`, `log_zone_warning`, `log_zone_notice`, `log_zone_info`, `log_zone_debug`
|
|
|
* zone events macros (ASCII name): `log_zone_str_fatal`, `log_zone_str_error`, `log_zone_str_warning`, `log_zone_str_notice`, `log_zone_str_info`, `log_zone_str_debug`
|
|
|
* low-level functions: `log_msg`, `log_msg_zone`, `log_msg_zone_str` |
|
|
\ No newline at end of file |