From: Simon Glass Date: Mon, 21 Jan 2019 18:12:39 -0700 Subject: [U-Boot] [PATCH 02/33] log: Add documentation for convenience functions In-Reply-To: <20190122011310.186491-1-sjg@chromium.org> References: <20190122011310.186491-1-sjg@chromium.org> Message-ID: <20190122011310.186491-3-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- doc/README.log | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/doc/README.log b/doc/README.log index 2ee1b753bc..96bc9523ef 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 ------------ -- 2.20.1.321.g9e740568ce-goog