Lugdunum
0.1.0
include
lug
System
Logger
FileHandler.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <fstream>
4
#include <
lug/System/Export.hpp
>
5
#include <
lug/System/Logger/Handler.hpp
>
6
#include <
lug/System/Logger/Message.hpp
>
7
8
namespace
lug
{
9
namespace
System {
10
namespace
Logger {
11
12
class
LUG_SYSTEM_API
FileHandler
:
public
Handler
{
13
public
:
14
// TODO: handle windows's wstring for filenames, had a nasty compiler error and this can be
15
// fixed later
16
FileHandler
(
const
std::string& name,
const
std::string& filename,
bool
truncate);
17
18
FileHandler
(
const
FileHandler
&) =
delete
;
19
FileHandler
(
FileHandler
&&) =
delete
;
20
21
FileHandler
& operator=(
const
FileHandler
&) =
delete
;
22
FileHandler
& operator=(
FileHandler
&&) =
delete
;
23
24
~
FileHandler
();
25
26
void
handle(
const
priv::Message& msg);
27
void
flush();
28
29
private
:
30
std::ofstream
_ofs
;
31
};
32
33
}
// Logger
34
}
// System
35
}
// lug
Message.hpp
Handler.hpp
lug::System::Logger::Handler
Definition:
Handler.hpp:15
Export.hpp
LUG_SYSTEM_API
#define LUG_SYSTEM_API
Definition:
Export.hpp:11
lug::System::Logger::FileHandler
Definition:
FileHandler.hpp:12
lug::System::Logger::FileHandler::_ofs
std::ofstream _ofs
Definition:
FileHandler.hpp:30
lug
Definition:
Application.hpp:11
Generated by
1.8.13