-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhalvoeLog.hpp
More file actions
38 lines (33 loc) · 1.12 KB
/
Copy pathhalvoeLog.hpp
File metadata and controls
38 lines (33 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#define DEBUGLOG_DEFAULT_LOG_LEVEL_INFO
#define DEBUGLOG_DEFAULT_FILE_LEVEL_INFO
#define DEBUGLOG_ENABLE_FILE_LOGGER
#include <SD.h> // this header is needed, because for file logging FILE_WRITE has to be defined and FS.h (included by SD.h) defines FILE_WRITE properly
#include <DebugLog.h>
#include <StreamUtils.hpp>
#include <elapsedMillis.h>
namespace halvoeAudioBoard
{
class LogFileManager
{
private:
const char* m_logFilePath;
const unsigned long m_logFileFlushInterval; // in seconds
elapsedSeconds m_timeSinceFlush;
bool m_isSetup = false;
const char* m_logFilePathAudioLibrary;
const unsigned long m_logFileFlushIntervalAudioLibrary; // in seconds
elapsedSeconds m_timeSinceFlushAudioLibrary;
File m_logFileAudioLibrary;
StreamUtils::LoggingStream m_logStreamAudioLibrary;
bool m_isSetupAudioLibrary = false;
public:
LogFileManager();
bool setup();
bool isSetup() const;
bool isSetupAudioLibrary() const;
StreamUtils::LoggingStream& getLogStreamAudioLibrary();
void flush();
void flushAudioLibrary();
};
}