summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-02-16 20:24:36 -0700
committerBin Meng <bmeng.cn@gmail.com>2019-02-20 15:21:44 +0800
commit8dee7b96fd6eaea54400aaf317f72aac9b323b58 (patch)
tree5d95cc4ad00f6bf97a5c312576c6758d7bd4210a
parentf0b05c95e3906fc25989e245b421dc5ec6becd72 (diff)
downloadu-boot-8dee7b96fd6eaea54400aaf317f72aac9b323b58.tar.gz
u-boot-8dee7b96fd6eaea54400aaf317f72aac9b323b58.tar.bz2
u-boot-8dee7b96fd6eaea54400aaf317f72aac9b323b58.zip
log: Add documentation for convenience functions
The log_debug(), etc. function are documented only in the header file at present. Add a section to README.log also. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
-rw-r--r--doc/README.log36
1 files changed, 26 insertions, 10 deletions
diff --git a/doc/README.log b/doc/README.log
index 2ee1b753bc..75350ecd41 100644
--- a/doc/README.log
+++ b/doc/README.log
@@ -69,6 +69,32 @@ If CONFIG_LOG is not set, then no logging will be available.
The above have SPL versions also, e.g. CONFIG_SPL_MAX_LOG_LEVEL.
+Convenience functions
+---------------------
+
+A number of convenience functions are available to shorten the code needed
+for logging:
+
+ log_err(_fmt...)
+ log_warning(_fmt...)
+ log_notice(_fmt...)
+ log_info(_fmt...)
+ log_debug(_fmt...)
+ log_content(_fmt...)
+ log_io(_fmt...)
+
+With these the log level is implicit in the name. The category is set by
+LOG_CATEGORY, which you can only define once per file, above all #includes:
+
+ #define LOG_CATEGORY LOGC_ALLOC
+
+or
+
+ #define LOG_CATEGORY UCLASS_SPI
+
+Remember that all uclasses IDs are log categories too.
+
+
Log commands
------------
@@ -187,16 +213,6 @@ Convenience functions to support setting the category:
log_core(level, format_string, ...) - category LOGC_CORE
log_dt(level, format_string, ...) - category LOGC_DT
-Convenience functions to support a category defined for a single file, for
-example:
-
- #define LOG_CATEGORY UCLASS_USB
-
-all of these can use LOG_CATEGORY as the category, and a log level
-corresponding to the function name:
-
- logc(level, format_string, ...)
-
More logging destinations:
device - goes to a device (e.g. serial)