summaryrefslogtreecommitdiff
path: root/lib/log.c
diff options
context:
space:
mode:
authorAlexander Amelkin <alexander@amelkin.msk.ru>2020-07-17 03:29:42 +0300
committerAlexander Amelkin <alexander@amelkin.msk.ru>2020-07-17 03:33:46 +0300
commitdc163d4cdc5c18daf27428f3409d8c8a8761a23c (patch)
tree1992ca0d91944ce8f26f42c34a16873c0d0381ac /lib/log.c
parent3a1a9cb28320cf3ea712d53403b983abdd49d923 (diff)
downloadipmitool-feature/debug-improvements.tar.gz
Add version info to debug outputfeature/debug-improvements
- Initialize the log at the start of ipmi_main() to allow for proper logging at the start; - Remove the unused log_level_get() function; - Update log_level_set() to take verbosity instead of log level (default verbosity is 0, which is LOG_NOTICE log level), use the function to update log level as `-v` is encountered in command line; - Move IANA PEN list debugging to verbosity 6. The list is too long to see it in each debug output of verbosity 5 that is used for debugging lan/lanplus packets; - For verbosity >= 2 (that is `-vv`) add the ipmitool version information at the start. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
Diffstat (limited to 'lib/log.c')
-rw-r--r--lib/log.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/log.c b/lib/log.c
index 1226b8d..ecc47a8 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -144,13 +144,8 @@ void log_halt(void)
logpriv = NULL;
}
-int log_level_get(void)
+void log_level_set(int verbose)
{
- return logpriv->level;
-}
-
-void log_level_set(int level)
-{
- logpriv->level = level;
+ logpriv->level = verbose + LOG_NOTICE;
}