Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DebugLog/Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace debug {
bool b_base_reset {true};

#ifdef ARDUINO
Stream* stream {&Serial};
Stream* stream {&DEBUGLOG_DEFAULT_ARDUINO_STREAM};
FileLogger* logger {nullptr};
LogLevel file_lvl {DEBUGLOG_DEFAULT_FILE_LEVEL};
bool b_auto_save {false};
Expand Down
4 changes: 4 additions & 0 deletions DebugLog/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,8 @@ namespace debug {
#define DEBUGLOG_DEFAULT_FILE_LEVEL LogLevel::LVL_ERROR
#endif

#ifndef DEBUGLOG_DEFAULT_ARDUINO_STREAM
#define DEBUGLOG_DEFAULT_ARDUINO_STREAM Serial
#endif

#endif // DEBUGLOG_TYPES_H
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ LOG_ATTACH_STREAM(your_tcp_client);
LOG_ATTACH_STREAM(any_other_stream);
```

The default can be changed by defining `DEBUGLOG_DEFAULT_ARDUINO_STREAM` before including `DebugLog.h`:

```cpp
#define DEBUGLOG_DEFAULT_ARDUINO_STREAM Serial2
#include <DebugLog.h>
```

### Log Preamble Control

The `LOG_PREAMBLE` macro is called every `LOG_XXXX`. It defines a string that will be printed between the `[LEVEL]` and your custom message. To override the default definition, you must define the macro **before** you `#include <DebugLog.h>`
Expand Down