summaryrefslogtreecommitdiff
path: root/doc/develop/logging.rst
AgeCommit message (Collapse)AuthorFilesLines
2021-06-08log: Convert log values to printf() if not enabledSimon Glass1-2/+4
At present if logging not enabled, log_info() becomes a nop. But we want log output at the 'info' level to be akin to printf(). Update the macro to pass the output straight to printf() in this case. This mimics the behaviour for the log_...() macros like log_debug() and log_info(), so we can drop the special case for these. Add new tests to cover this case. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-13log: Add return-checking macros for 0 being successSimon Glass1-1/+14
The existing log_ret() and log_msg_ret() macros consider an error to be less than zero. But some function may return a positive number to indicate a different kind of failure. Add macros to check for that also. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-03-13log: Handle line continuationSimon Glass1-0/+16
When multiple log() calls are used which don't end in newline, the log prefix is prepended multiple times in the same line. This makes the output look strange. Fix this by detecting when the previous log record did not end in newline. In that case, setting a flag. Drop the unused BUFFSIZE in the test while we are here. As an example implementation, update log_console to check the flag and produce the expected output. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-27doc: fix doc/develop/logging.rstHeinrich Schuchardt1-10/+3
Sphinx 3 builds fail due to doc/develop/logging.rst producing duplicate labels. Include logging.h only once in the API section and use cross-references for the enums log_level_t and log_category_t. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-10-30doc: Update logging documentationSean Anderson1-114/+107
This updates logging documentation with some examples of the new commands added in the previous commits. It also removes some items from the to-do list which have been implemented. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-30doc: Add log kerneldocs to documentationSean Anderson1-0/+5
The functions in log.h are already mostly documented, so add them to the generated documentation. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-27log: allow for message continuationHeinrich Schuchardt1-0/+6
Some drivers use macro pr_cont() for continuing a message sent via printk. Hence if we want to convert printk messaging to using the logging system, we must support continuation of log messages too. As pr_cont() does not provide a message level we need a means of remembering the last log level. With the patch a pseudo log level LOGL_CONT as well as a pseudo log category LOGC_CONT are introduced. Using these results in the application of the same log level and category as in the previous log message. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-22log: Tidy up documentationSimon Glass1-5/+8
Fix up the documentation which was lost in a merge conflict in the conversion to RST. Fixes: 52d3df7fefe ("log: Allow LOG_DEBUG to always enable log output") Signed-off-by: Simon Glass <sjg@chromium.org>
2020-06-12doc: move README.log to HTML documentationHeinrich Schuchardt1-0/+290
Convert README.log to reStructuredText and add it to the generated HTML documentation. Assign doc/develop/logging.rst to the maintainer of LOGGING. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>