]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
tools/tools-common.h: introduce CGROUP_LOG_CONT level for logging
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 23 Aug 2022 17:24:50 +0000 (11:24 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 23 Aug 2022 17:24:53 +0000 (11:24 -0600)
commit3966b27e44c0fab07af16992d5d66a50d59adafd
treedcd20504e2e76a7475d4049a8fb7f9d568b441cb
parent727b6ba53afe7dd8306d35869d8ab8273ca644e3
tools/tools-common.h: introduce CGROUP_LOG_CONT level for logging

There are cases, where we might want to print a very long/multiline log
message to the user. We could call the cgroup_log(), multiple times
to fit the log message, but the downside is that every time the
cgroup_log() called, the log level is prefixed to the message, hence
introducing loglevel char string in the mid of the log message.

Introduce a new logging level, CGROUP_LOG_CONT and cgroup_cont() macro,
that will continue printing the log message, when loglevel is set to
other than default log level. The above code can be rewritten as:

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
TJH: Fix typo in commit message
(cherry picked from commit db2039f6ad75988e0aad3f5306d5d8c02aa4b040)
src/tools/tools-common.h