blob: 78fba808426bfead825b2641688ea5f7853670dd [file] [log] [blame]
akmhoque85d88332014-02-17 21:11:21 -06001#ifndef NLSR_LOGGER_HPP
2#define NLSR_LOGGER_HPP
3
4#define BOOST_LOG_DYN_LINK 1
5
6#include <stdexcept>
7#include <string>
8#include <iostream>
9#include <sstream>
10#include <pwd.h>
11#include <cstdlib>
12#include <string>
13#include <unistd.h>
14#include <boost/format.hpp>
15#include <boost/smart_ptr/shared_ptr.hpp>
16#include <boost/date_time/posix_time/posix_time.hpp>
17#include <boost/date_time/local_time/local_time.hpp>
18#include <boost/log/common.hpp>
19#include <boost/log/expressions.hpp>
20#include <boost/log/attributes.hpp>
21#include <boost/log/sources/logger.hpp>
22#include <boost/log/sinks/sync_frontend.hpp>
23#include <boost/log/sinks/text_file_backend.hpp>
24
akmhoque92afde42014-02-18 14:04:07 -060025
akmhoque85d88332014-02-17 21:11:21 -060026namespace logging = boost::log;
27namespace attrs = boost::log::attributes;
28namespace src = boost::log::sources;
29namespace sinks = boost::log::sinks;
30namespace expr = boost::log::expressions;
31namespace keywords = boost::log::keywords;
32
33using boost::shared_ptr;
34using namespace std;
35
36
akmhoque85d88332014-02-17 21:11:21 -060037class NlsrLogger
38{
39public:
40 NlsrLogger()
41 {
42 }
43
44 void initNlsrLogger(std::string dirPath);
45
akmhoque92afde42014-02-18 14:04:07 -060046 src::logger& getLogger()
akmhoque85d88332014-02-17 21:11:21 -060047 {
48 return mLogger;
49 }
50
51private:
52 string getEpochTime();
53 string getUserHomeDirectory();
54
55private:
akmhoque92afde42014-02-18 14:04:07 -060056 src::logger mLogger;
akmhoque85d88332014-02-17 21:11:21 -060057};
58
59#endif