File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 1
- # ArduinoLogging
2
- Log framework for Arduino supporting levels and handlers.
1
+ # ArduinoSimpleLogging
2
+
3
+ Simple logging-framework for Arduino supporting levels and handlers.
4
+
5
+ It provides a static ` Logger ` instance that has static ` Print ` instances as members.
6
+ These members are ` debug ` , ` info ` , ` warning ` and ` error ` and represent preconfigured log targets for the available log levels.
7
+
8
+ As these are ` Print ` instances, you can use them as drop-in-replacement for ` Serial ` .
9
+ For example instead of ` Serial.println("Hello") ` you just write ` Logger.debug.println("Hello") ` .
10
+ This will print the String ` Hello ` to all streams that are configured for ` DEBUG ` .
11
+
12
+ To configure a ` Print ` instance for a log level you simply add it as log handler.
13
+ For example, to log all log messages to ` Serial ` you need to call:
14
+ ``` cpp
15
+ Logger.addHandler(Logger.DEBUG, Serial);
16
+ ```
17
+
18
+ Log levels are including.
19
+ That means, that when you configure a handler for a certain level, you'll get everything up to this level.
20
+ The available levels are: ` ERROR ` , ` WARNING ` , ` INFO ` , ` DEBUG ` with debug the highest level.
21
+ So if you configure your Handler for ` DEBUG ` , you'll get messages for all levels.
22
+ If you configure for ` ERROR ` , you'll get only error messages.
You can’t perform that action at this time.
0 commit comments