
Hi Masahiro,
On 19 September 2017 at 21:04, Masahiro Yamada yamada.masahiro@socionext.com wrote:
Hi Simon
2017-09-17 6:23 GMT+09:00 Simon Glass sjg@chromium.org:
+To Do +-----
+There are lots of useful additions that could be made. None of the below is +implemented! If you do one, please add a test in test/py/tests/test_log.py
+Convenience functions to support setting the category:
- log_arch(level, format_string, ...) - category LOGC_ARCH
- log_board(level, format_string, ...) - category LOGC_BOARD
- log_core(level, format_string, ...) - category LOGC_CORE
- log_dt(level, format_string, ...) - category LOGC_DT
I do not want to see any more proliferation of log functions...
So just a function where you specify the category?
+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, ...)
- pr_panic(format_string, ...)
- pr_crit(format_string, ...)
- pr_err(format_string, ...)
- pr_warn(format_string, ...)
- pr_note(format_string, ...)
- pr_info(format_string, ...)
- pr_detail(format_string, ...)
- pr_debug(format_string, ...)
Linux uses:
pr_emerg(fmt, ...) pr_alert(fmt, ...) pr_crit(fmt, ...) pr_err(fmt, ...) pr_warn(fmt, ...) pr_notice(fmt, ...) pr_info(fmt, ...) pr_debug(fmt, ...)
Please do not invent similar, but different APIs.
See my comment about log levels in the previous patch. I can keep these all the same but want to add at least one more detail level.
Regards, Simon