Skip to content

Commit 6b2c9eb

Browse files
committed
Default log level with AUDIO_DRIVER_LOG_LEVEL
1 parent 24493c6 commit 6b2c9eb

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ The functionality has a built in logger. The default log level has been set to W
5353
```
5454
Valid values are: Debug, Info, Warning, Error
5555

56+
You can deactivate the logging completly and if you are using an ESP32, you can configure the use of the built in ESP32 IDF logger in AudioDriverConfig.h
57+
5658
## Documentation
5759

5860
- [Wiki](https://github.com/pschatzmann/arduino-audio-driver/wiki)

src/AudioDriverConfig.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
# define AUDIO_DRIVER_LOGGIN_ACTVIE true
4545
#endif
4646

47+
/// Define the default log level for the standard logger (2=Warning)
48+
#ifndef AUDIO_DRIVER_LOG_LEVEL
49+
# define AUDIO_DRIVER_LOG_LEVEL 2
50+
#endif
51+
4752
/// Use IDF Logger: by default we use it if ESP32 outside of ARDUINO
4853
#if !defined(AUDIO_DRIVER_LOGGING_IDF) && defined(ESP32_CMAKE)
4954
# define AUDIO_DRIVER_LOGGING_IDF

src/Platforms/AudioDriverLogger.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
#ifdef ARDUINO
1010
# include "Print.h"
1111
#endif
12-
1312
// define supported log levels
14-
enum class AudioDriverLogLevel {Debug=0, Info, Warning, Error};
13+
enum class AudioDriverLogLevel {Debug=0, Info=1, Warning=2, Error=3};
14+
1515

1616
/***
1717
* C++ API to configure logging

src/Platforms/LoggerSTD.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Print *p_audio_driver_log_output = &Serial;
1111
#endif
1212

1313
// Default log level is warning
14-
int LOGLEVEL_AUDIODRIVER = 2;
14+
int LOGLEVEL_AUDIODRIVER = AUDIO_DRIVER_LOG_LEVEL;
1515

1616
void AD_LOGD(const char* fmr, ...) {
1717
if (LOGLEVEL_AUDIODRIVER <= 0) { // LOGLEVEL_AUDIODRIVER = Debug

0 commit comments

Comments
 (0)