-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogging.cpp
More file actions
37 lines (31 loc) · 753 Bytes
/
Logging.cpp
File metadata and controls
37 lines (31 loc) · 753 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
32
33
34
35
36
37
#include "Logging.h"
#include <iostream>
namespace CompressTools
{
static void DefaultDebugLogger(const char* message)
{
std::cout << message << std::endl;
}
static void DefaultErrorLogger(const char* message)
{
std::cout << "Error: " << message << std::endl;
}
static void(*DebugLogger)(const char* message) = DefaultDebugLogger;
static void(*ErrorLogger)(const char* message) = DefaultErrorLogger;
void DebugLog(std::string message)
{
DebugLogger(message.c_str());
}
void ErrorLog(std::string message)
{
ErrorLogger(message.c_str());
}
void SetDebugLogger(void(*newLogger)(const char* message))
{
DebugLogger = newLogger;
}
void SetErrorLogger(void(*newLogger)(const char* message))
{
ErrorLogger = newLogger;
}
}