-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLogger.cpp
65 lines (57 loc) · 1.17 KB
/
Logger.cpp
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
/**
* Logging implementation. Use the global instance of this class to log everything. Will wrap to file later
*
* Author: Skylar Payne
* Date: 7/24/2013
* File: Logger.h
**/
#include "Logger.h"
#include <iostream>
Logger g_Logger;
/**
* @brief Debug::operator << logs a string
* @param c the string to log
* @return the global logger
*/
Logger& Logger::operator<<(const char* c)
{
std::cout << c;
return g_Logger;
}
/**
* @brief Logger::operator << logs an integer
* @param i the integer to log
* @return the global logger
*/
Logger& Logger::operator<<(const int i)
{
std::cout << i;
return g_Logger;
}
/**
* @brief Logger::operator << logs an unsigned integer
* @param i the integer to log
* @return the global logger
*/
Logger& Logger::operator<<(const unsigned int i)
{
std::cout << i;
return g_Logger;
}
/**
* @brief Logger::operator << logs a float
* @param f the float to log
* @return the global logger
*/
Logger& Logger::operator<<(const float f)
{
std::cout << f;
return g_Logger;
}
/**
* @brief Logger::flush flushes all streams to which the logger writes
*/
void Logger::flush()
{
std::cout.flush();
}