-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathapp_log.cpp
More file actions
42 lines (30 loc) · 999 Bytes
/
app_log.cpp
File metadata and controls
42 lines (30 loc) · 999 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
38
39
40
41
42
#include "application/tools/app_log.hpp"
#include <iostream>
#include <string_view>
//------------------------------------------------------------------------------
namespace application
{
//------------------------------------------------------------------------------
Log::Log()
: m_stream{ std::cout }
, m_errorStream{ std::cerr }
{
}
//------------------------------------------------------------------------------
Log::Log( std::ostream & _stream, std::ostream & _errorStream )
: m_stream{ _stream }
, m_errorStream{ _errorStream }
{
}
//------------------------------------------------------------------------------
void Log::printLine( std::string_view _line )
{
m_stream << _line << std::endl;
}
//------------------------------------------------------------------------------
void Log::printWarning( const std::exception & _exception )
{
m_errorStream << _exception.what() << std::endl;
}
//------------------------------------------------------------------------------
}