-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogger.hpp
45 lines (32 loc) · 941 Bytes
/
logger.hpp
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
#ifndef LOGGER_H
#define LOGGER_H
#include <algorithm>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <memory>
#include <string>
#include <thread>
#include <vector>
#include <mutex>
#include <fstream>
#include <sstream>
#include <windows.h>
#include <boost/format.hpp>
#include <boost/system/error_code.hpp>
#include "config.h"
class logger
{
private:
static std::mutex access_log_;
static std::ostringstream formatLog(const char *type, const char *what);
static std::ostringstream formatLog(const char *type, const char *what, const char *errorMsg);
static std::streampos logger::fileSize(const char* filePath);
static void writeLog(std::string logData);
public:
static void fail(char const* what);
static void fail(boost::system::error_code ec, char const* what);
static void fail(boost::system::error_code ec, std::string what);
static void debug(std::string what);
};
#endif