Grail (C++)  1.3.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
FileSink.hh
1 // Copyright QED Software 2023.
2 
3 #ifndef GRAIL_FILE_SINK_H
4 #define GRAIL_FILE_SINK_H
5 
6 #include "Sink.hh"
7 
8 #include <fstream>
9 
10 namespace grail
11 {
12 namespace logger
13 {
17  class FileSink : public Sink
18  {
19  public:
25  FileSink(const std::string& filename, bool isSynchronized = false);
26 
27  protected:
28  virtual void Log(const std::string& loggerName,
29  Severity severity,
30  const std::string& message,
31  const std::string& logFileLocation,
32  const std::size_t& logLineNumber) override;
33 
34  private:
35  std::ofstream fileStream;
36  };
37 }
38 }
39 
40 #endif //GRAIL_FILE_SINK_H
grail::logger::FileSink
The FileSink class - sink writing messages to file.
Definition: FileSink.hh:17
grail::logger::FileSink::Log
virtual void Log(const std::string &loggerName, Severity severity, const std::string &message, const std::string &logFileLocation, const std::size_t &logLineNumber) override
Log - override this method to define how the messege should be logged.
Definition: FileSink.cpp:17
grail::logger::Sink
The Sink class - destination of logger messages.
Definition: Sink.hh:18
grail::logger::FileSink::FileSink
FileSink(const std::string &filename, bool isSynchronized=false)
FileSink.
Definition: FileSink.cpp:12