-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlogger.h
More file actions
31 lines (26 loc) · 572 Bytes
/
logger.h
File metadata and controls
31 lines (26 loc) · 572 Bytes
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
#pragma once
#ifndef __CLOG__
#define __CLOG__
#include "rw_lock.h"
#include <fstream>
#include <string>
#include <tchar.h>
using namespace std;
class logger {
public:
logger();
~logger();
template <class T>
static void WriteLog(T x);
static void WriteLogFormat(const char *format, ...);
static string GetSystemTimes();
};
template <class T>
void logger::WriteLog(T x) {
fstream of("igdlLog.txt", ios::app);
if (!of.is_open()) return;
of.seekp(ios::end);
of << GetSystemTimes() << ": " << x << endl;
of.close();
}
#endif