From 7a3b07f65d76215b2a2471a0a0833978484f064c Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Wed, 30 Mar 2022 06:28:24 -0500 Subject: [PATCH] Update Logging.md --- docs/Logging.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/Logging.md b/docs/Logging.md index a2a6d43..43c348d 100644 --- a/docs/Logging.md +++ b/docs/Logging.md @@ -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, ...)*