Update Logging.md

This commit is contained in:
HomeSpan 2022-03-30 06:28:24 -05:00 committed by GitHub
parent c7a515b4be
commit 7a3b07f65d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 0 deletions

View File

@ -1,5 +1,26 @@
# Message Logging
HomeSpan includes three types of message logging:
* **HomeSpan Log Messages** - these are messages produced by HomeSpan and output to the Arduino Serial Monitor. The messages are categorized according to 3 levels of detail
* Level-0 messages contain all HomeSpan configuration data and some basic status information
* Level-1 adds in a more verbose set of status messages
* Level-2 further includes all HAP communication packages to and from the HomeSpan device.
* Users can programmatically control which log messages are output to the Serial Monitor by setting the log level using the homeSpan method `setLogLevel(uint8_t level)` as described in the [HomeSpan API Reference](API.md). Level-0 messages are always output. Level-1 messages are only output if the log level is set to 1 or greater. Level-2 messages are only output if the log level is set to to 2
* The log level can also be changed dynamically via the Serial Monitor at any time via the 'L' as described in the [HomeSpan CLI](CLI.md).
1. **User Log Messages** - these are messages produced by the user and output to the Arduino Serial. User can output messages using either the Arduino standard Serial.print(x) method, or the
= top-level HomeSpan status messages, and any messages output by the user using Serial.print() or Serial.printf() (default)
1 = all HomeSpan status messages, and any LOG1() messages specified in the sketch by the user
2 = all HomeSpan status messages plus all HAP communication packets to and from the HomeSpan device, as well as all LOG1() and LOG2() messages specified in the sketch by the user
### *LOG1(X)* and *LOG2(X)*
### *LOG1(const char \*fmt, ...)* and *LOG2(const char \*fmt, ...)*