VNMediaClientNET

Logger.h
1 #ifndef LOGGER_H
2 #define LOGGER_H
3
4 #include <string>
5 #include <list>
6 #include <stdio.h>
7
8 class Logger
9 {
10 private:
11 Logger();
12 ~Logger();
13
14 /*struct FileDescr {
15 FILE* file;
16 Level level;
17 };*/
18
19 public:
20 enum Level { LL_DEBUG, LL_INFO, LL_ALERT, LL_WARN, LL_ERROR, LL_FATAL };
21
22 static void attachLogFile( const std::string& fileName );
23 static void attachLogFILE( FILE* f );
24 static void setLogLevel( Level level );
25 static void logAs( Level level, const std::string& message );
26 static void debug( const std::string& message ) { logAs( LL_DEBUG, message ); }
27 static void info( const std::string& message ) { logAs( LL_INFO, message ); }
28 static void alert( const std::string& message ) { logAs( LL_ALERT, message ); }
29 static void warn( const std::string& message ) { logAs( LL_WARN, message ); }
30 static void error( const std::string& message ) { logAs( LL_ERROR, message ); }
31 static void fatal( const std::string& message ) { logAs( LL_FATAL, message ); }
32
33 private:
34 static Logger logger;
35 private:
36 std::list< FILE* > files;
37 Level level;
38 };
39
40 #endif // LOGGER_H
Logger
Definition: Logger.h:9