ESP  0.1
The Example-based Sensor Predictions (ESP) system tries to bring machine learning to the maker community.
ofConsoleFileLoggerChannel.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <ofLog.h>
4 
6 class ofConsoleFileLoggerChannel: public ofBaseLoggerChannel{
7 public:
10 
14  ofConsoleFileLoggerChannel(const string & path, bool append);
15 
19  void setFile(const string & path,bool append=false);
20 
21  void log(ofLogLevel level, const string & module, const string & message);
22  void log(ofLogLevel level, const string & module, const char* format, ...) OF_PRINTF_ATTR(4, 5);
23  void log(ofLogLevel level, const string & module, const char* format, va_list args);
24 
26  void close();
27 
36  void setConsoleLogLevel(ofLogLevel level) { consoleLogLevel = level; }
37 
46  void setFileLogLevel(ofLogLevel level) { fileLogLevel = level; }
47 
48 private:
49  ofConsoleLoggerChannel consoleLogger;
50  ofFileLoggerChannel fileLogger;
51 
52  ofLogLevel consoleLogLevel = OF_LOG_VERBOSE;
53  ofLogLevel fileLogLevel = OF_LOG_VERBOSE;
54 };
void close()
CLose the log file.
Definition: ofConsoleFileLoggerChannel.cpp:8
void setConsoleLogLevel(ofLogLevel level)
Set the minimum log level for the console log.
Definition: ofConsoleFileLoggerChannel.h:36
void setFile(const string &path, bool append=false)
Set the log file.
Definition: ofConsoleFileLoggerChannel.cpp:12
ofConsoleFileLoggerChannel()
Create an ofConsoleFileLoggerChannel.
Definition: ofConsoleFileLoggerChannel.cpp:3
A logger channel that logs its messages to the console and a log file.
Definition: ofConsoleFileLoggerChannel.h:6
void setFileLogLevel(ofLogLevel level)
Set the minimum log level for the file log.
Definition: ofConsoleFileLoggerChannel.h:46
void log(ofLogLevel level, const string &module, const string &message)
Definition: ofConsoleFileLoggerChannel.cpp:16