-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog.h
90 lines (67 loc) · 1.25 KB
/
log.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*******************************************************************
*
* DESCRIPTION: class Log
*
* AUTHOR: Alejandro Troccoli
*
* EMAIL: mailto://[email protected]
*
* DATE: 02/04/2001
*
*******************************************************************/
#ifndef __LOG_H
#define __LOG_H
#include <string>
/** declarations **/
class Log
{
public:
enum LogType {
logAll = 255 ,
logCollect = 1,
logInternal = 2,
logDone = 4,
logOutput = 8,
logExternal = 16,
logInit = 32,
logSent = 64,
logNone = 0
};
Log();
Log& createLog( bool );
bool createLog();
Log& logToStdOut( bool );
bool logToStdOut();
std::string filename();
Log& filename( const char *);
Log& filename( const std::string& );
Log& logType( const char* ); //creates the logtype from the command line modifiers.
unsigned logType();
static Log Default;
private:
bool blLogToStdOut;
std::string strLogFileName;
unsigned type;
}; // Log
/** inlines **/
inline Log::Log() :
blLogToStdOut(true)
, type(logNone)
{}
inline bool Log::createLog()
{
return (type != logNone);
}
inline bool Log::logToStdOut()
{
return blLogToStdOut;
}
inline std::string Log::filename()
{
return strLogFileName;
}
inline unsigned Log::logType()
{
return type;
}
#endif //__LOG_H