Re: [U-Boot] [PATCH 13/13] log: Add documentation

2017-09-20 Thread Simon Glass
Hi Masahiro,

On 19 September 2017 at 21:04, Masahiro Yamada
 wrote:
> Hi Simon
>
>
> 2017-09-17 6:23 GMT+09:00 Simon Glass :
>
>> +
>> +
>> +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
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 13/13] log: Add documentation

2017-09-19 Thread Masahiro Yamada
Hi Simon


2017-09-17 6:23 GMT+09:00 Simon Glass :

> +
> +
> +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...



> +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.



-- 
Best Regards
Masahiro Yamada
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 13/13] log: Add documentation

2017-09-17 Thread Bin Meng
On Sun, Sep 17, 2017 at 5:23 AM, Simon Glass  wrote:
> Add documentation for the log system.
>
> Signed-off-by: Simon Glass 
> ---
>
>  doc/README.log | 220 
> +
>  1 file changed, 220 insertions(+)
>  create mode 100644 doc/README.log
>

Reviewed-by: Bin Meng 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot