summaryrefslogtreecommitdiff
path: root/include/log.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-12-28 13:14:17 -0700
committerSimon Glass <sjg@chromium.org>2018-02-03 10:09:27 -0700
commit3b73e8d067fb7cb504bed2018583980a3cd3f4bc (patch)
tree2544f15394f2d107675c06611649eb5efe8e35fd /include/log.h
parentf941c8d76c665045e5d645112a309d12523e19c7 (diff)
log: Add control over log formatting
It is useful to be able to control the output format of log records on the console. As a starting point, add definitions for controlling which elements of the log record are displayed. Use function and message as the default, since these are the most useful fields. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/log.h')
-rw-r--r--include/log.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/log.h b/include/log.h
index 5133213acf..828919a409 100644
--- a/include/log.h
+++ b/include/log.h
@@ -291,6 +291,20 @@ const char *log_get_level_name(enum log_level_t level);
*/
enum log_level_t log_get_level_by_name(const char *name);
+/* Log format flags (bit numbers) for gd->log_fmt. See log_fmt_chars */
+enum log_fmt {
+ LOGF_CAT = 0,
+ LOGF_LEVEL,
+ LOGF_FILE,
+ LOGF_LINE,
+ LOGF_FUNC,
+ LOGF_MSG,
+
+ LOGF_COUNT,
+ LOGF_DEFAULT = (1 << LOGF_FUNC) | (1 << LOGF_MSG),
+ LOGF_ALL = 0x3f,
+};
+
/* Handle the 'log test' command */
int do_log_test(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]);