-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdapter.cpp
47 lines (37 loc) · 841 Bytes
/
Adapter.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
#include <iostream>
#include "Adapter.h"
using namespace std;
AdapterLogger::AdapterLogger()
{
cout << "Logger Created" << endl;
}
void AdapterLogger::log(LogLevel level, string str)
{
cout << getLogLevelToString(level).data() << ": " << str << endl;
}
string_view AdapterLogger::getLogLevelToString(LogLevel level) const
{
switch (level)
{
case AdapterLogger::LogLevel::Error:
return "Error";
case AdapterLogger::LogLevel::Info:
return "Info";
case AdapterLogger::LogLevel::Debug:
return "Debug";
}
throw runtime_error("Invalid Log Level");
}
NewLoggerAdapter::NewLoggerAdapter()
{
cout << "New Logger Adapter created" << endl;
}
void NewLoggerAdapter::log(string_view message)
{
mLogger.log(AdapterLogger::LogLevel::Info, message.data());
}
int main()
{
NewLoggerAdapter logger;
logger.log("Å×½ºÆ®ÁßÀÌ¿¡¿ä");
}