diff options
author | Suraj Jitindar Singh <sjitindarsingh@gmail.com> | 2017-04-27 14:48:58 +1000 |
---|---|---|
committer | Andrew Jeffery <andrew@aj.id.au> | 2017-05-04 01:20:23 +0000 |
commit | 2851959877213f23fe5317b9a738d06db41a6666 (patch) | |
tree | efaa77cff69a17ae7b97a943fb7a25062c5cf46d /common.h | |
parent | 5a3a0664b63feba8aff288a5691a9f873e4ea6eb (diff) | |
download | phosphor-mboxd-2851959877213f23fe5317b9a738d06db41a6666.tar.gz phosphor-mboxd-2851959877213f23fe5317b9a738d06db41a6666.zip |
mboxd: Introduce a new DEBUG log level
Currently there is no output on the console unless -v is specified on
the command line which enables error output. A second -v will provide
info output.
We probably want error output irrespective of whether a -v was given
on the command line because people generally want to know why their
program stopped working.
Make error output unconditional.
A single -v will give minimal informational output which is a good
level to see what the daemon is doing without barfing all over the
console.
A second -v will enable debug output which will print highly verbose
information which will be useful for debugging. Probably don't enable
this under normal circumstances.
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Change-Id: I3da25f7e4e9e976c17389fcceb1d85ef98de7e0a
Diffstat (limited to 'common.h')
-rw-r--r-- | common.h | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -27,16 +27,20 @@ enum { MBOX_LOG_NONE = 0, - MBOX_LOG_VERBOSE = 1, + MBOX_LOG_INFO = 1, MBOX_LOG_DEBUG = 2 } verbosity; -#define MSG_OUT(f_, ...) do { if (verbosity >= MBOX_LOG_DEBUG) { \ +/* Error Messages */ +#define MSG_ERR(f_, ...) mbox_log(LOG_ERR, f_, ##__VA_ARGS__) +/* Informational Messages */ +#define MSG_INFO(f_, ...) do { if (verbosity >= MBOX_LOG_INFO) { \ mbox_log(LOG_INFO, f_, ##__VA_ARGS__); \ } } while (0) -#define MSG_ERR(f_, ...) do { if (verbosity >= MBOX_LOG_VERBOSE) { \ - mbox_log(LOG_ERR, f_, ##__VA_ARGS__); \ - } } while (0) +/* Debug Messages */ +#define MSG_DBG(f_, ...) do { if (verbosity >= MBOX_LOG_DEBUG) { \ + mbox_log(LOG_DEBUG, f_, ##__VA_ARGS__); \ + } } while(0) void (*mbox_vlog)(int p, const char *fmt, va_list args); |