Skip to content

Commit 18700f8

Browse files
author
Janne Kiiskila
committed
Add compile time log enablement info
Add the information Tero Jääskö kindly provided via Slack. You can control the log levels compile and run-time.
1 parent 37da7ae commit 18700f8

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,24 @@ Logging (or tracing) can be enabled by modifying the [`mbed_app.json`](https://g
9797
```
9898
"mbed-trace.enable" : null,
9999
```
100+
By modifying that `null` to `1` and recompiling the application.
100101

101-
By modifying that `null` to 1 and recompiling the application. The application and client uses [`mbed-trace`](https://github.com/ARMmbed/mbed-trace) library for the logging, more fine-grained control is also possible by setting log levels (by calling `mbed_trace_config_set()`) and inclusions/exclusions (by calling `mbed_trace_include_filters_set()` or mbed_trace_exclude_filters_set()`).
102+
Log level can be modified compile-time by defining `MBED_TRACE_MAX_LEVEL` -macro to `mbed_app.json`:
103+
104+
```
105+
"target.macros_add": [
106+
"MBED_TRACE_MAX_LEVEL=TRACE_LEVEL_INFO",
107+
```
108+
109+
Default level is `TRACE_LEVEL_DEBUG`, possible values are:
110+
* `TRACE_LEVEL_DEBUG` (largest amounts of logs)
111+
* `TRACE_LEVEL_INFO`
112+
* `TRACE_LEVEL_WARN` and
113+
* `TRACE_LEVEL_ERROR` (smallest amount of logs).
114+
115+
Component level run-time control is also possible by setting log levels (by calling `mbed_trace_config_set()`) and inclusions/exclusions (by calling `mbed_trace_include_filters_set()` or mbed_trace_exclude_filters_set()`).
116+
117+
For more details, see the [`mbed-trace`](https://github.com/ARMmbed/mbed-trace) library.
102118

103119
## Troubleshooting
104120

0 commit comments

Comments
 (0)