「App:Library:LVGL:docs:Porting:Logging」の版間の差分
提供: robot-jp wiki
ナビゲーションに移動検索に移動| 27行目: | 27行目: | ||
| + | |||
| + | == Printing logs == | ||
| + | |||
| + | === Logging with printf === | ||
| + | If your system supports <code>printf</code>, you just need to enable <code>LV_LOG_PRINTF</code> in <code>lv_conf.h</code> to send the logs with <code>printf</code>. | ||
| + | |||
| + | === Custom log function === | ||
| + | If you can't use <code>printf</code> or want to use a custom function to log, you can register a "logger" callback with <code>lv_log_register_print_cb()</code>. | ||
---- | ---- | ||
[[App:Library:LVGL:docs:Porting|戻る : Previous]] | [[App:Library:LVGL:docs:Porting|戻る : Previous]] | ||
2022年6月22日 (水) 14:39時点における版
https://docs.lvgl.io/8.2/porting/log.html
| 英文 | 自動翻訳 |
|---|---|
Logging
LVGL has a built-in Log module to inform the user about what is happening in the library.
Log level
To enable logging, set LV_USE_LOG 1 in lv_conf.h and set LV_LOG_LEVEL to one of the following values:
LV_LOG_LEVEL_TRACEA lot of logs to give detailed informationLV_LOG_LEVEL_INFOLog important eventsLV_LOG_LEVEL_WARNLog if something unwanted happened but didn't cause a problemLV_LOG_LEVEL_ERROROnly critical issues, where the system may failLV_LOG_LEVEL_USEROnly user messagesLV_LOG_LEVEL_NONEDo not log anything
The events which have a higher level than the set log level will be logged too. E.g. if you LV_LOG_LEVEL_WARN, errors will be also logged.
Printing logs
Logging with printf
If your system supports printf, you just need to enable LV_LOG_PRINTF in lv_conf.h to send the logs with printf.
Custom log function
If you can't use printf or want to use a custom function to log, you can register a "logger" callback with lv_log_register_print_cb().