Wittyshare
0.2
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
wscore
src
Logger
WsLogWriter.h
Go to the documentation of this file.
1
/*
2
*
3
* Filename: WsLogWriter.h
4
*
5
* Description: Writes log data to file using atomic operation
6
* This class is a singleton and is Thread Safe
7
*
8
* Created: 02/16/12 10:13:45
9
*
10
* Author: Benoit Daccache, ben.daccache@gmail.com
11
*
12
*/
13
14
15
#ifndef WS_LOG_WRITER_H__
16
#define WS_LOG_WRITER_H__
17
18
#include <iostream>
19
#include <fstream>
20
21
#include <boost/date_time/posix_time/posix_time.hpp>
22
using namespace
boost::posix_time;
23
24
class
WsGlobalProperties
;
25
26
30
class
WsLogWriter
{
31
public
:
36
static
WsLogWriter
* instance();
37
43
void
write(
const
int
& level,
const
std::string& message);
44
48
~
WsLogWriter
();
49
50
protected
:
55
WsLogWriter
();
60
std::string toString(
int
level);
64
void
readConf();
65
66
private
:
67
static
WsLogWriter
*
m_instance
;
68
pthread_mutex_t
m_mutex
;
69
std::ofstream
m_logfile
;
70
int
m_logLevel
;
71
std::string
m_path
;
72
};
73
74
#endif
WsLogWriter::m_path
std::string m_path
Definition:
WsLogWriter.h:71
WsGlobalProperties
Global properties class.
Definition:
WsGlobalProperties.h:26
WsLogWriter::m_instance
static WsLogWriter * m_instance
Definition:
WsLogWriter.h:67
WsLogWriter
LogWriter, writes logs to file or screen.
Definition:
WsLogWriter.h:30
WsLogWriter::m_mutex
pthread_mutex_t m_mutex
Definition:
WsLogWriter.h:68
WsLogWriter::m_logLevel
int m_logLevel
Definition:
WsLogWriter.h:70
WsLogWriter::m_logfile
std::ofstream m_logfile
Definition:
WsLogWriter.h:69
Generated on Wed Apr 23 2014 14:00:11 for Wittyshare by
1.8.6