API Documentation
Loading...
Searching...
No Matches
LogManager.h
Go to the documentation of this file.
1#pragma once
2#include <NDEVR/Dictionary.h>
3#include <NDEVR/String.h>
4#include <NDEVR/Log.h>
5#include <NDEVR/BinaryFile.h>
6namespace NDEVR
7{
8 class AsciiFileOutputStream;
9 /**--------------------------------------------------------------------------------------------------
10 \brief A class that has any number of children that also feed into the log. Can be used to easily
11 collect logs from a variaty of different streams.
12 **/
14 {
15 public:
17 {
18 e_move
19 , e_copy
20 , e_ignore
21 };
22 bool hasLog(const String& log_name) const;
23 ProgressInfo* getLog(const String& log_name) const;
25 {
26 return getLog("DEFAULT");
27 }
28 void writeToFile(BinaryFile& file, uint01 minimum_log_level, CompressionMode mode = CompressionMode::e_default_compression);
29 void addStream(LogStream* stream, bool add_all) override;
30 void addLog(const String& name, ProgressInfo* info);
31 void removeStream(LogStream* stream) override;
32 void setDefaultAsciiLogPath(const File& file, MoveMode mode);
33 virtual bool setProgress(fltp04) override;
34 virtual void allowCancel(bool) override;
36 virtual bool addMessage(const TranslatedString&, uint01 = 10) override;
37 virtual bool addMessage(const LogMessage&) override;
38 virtual bool addMessage(const String&, uint01 = 10) override;
39 virtual bool addMessage(const char* const, uint01 = 10) override;
40 void logStartupInformation(const String& log) const;
41 virtual void setCancelRequest(bool) override;
47 };
48}
#define NDEVR_BASE_API
Definition DLLInfo.h:57
Logic for reading or writing to a binary file including logic for.
Definition BinaryFile.h:59
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A hash-based key-value store, useful for quick associative lookups. Key features include:
Definition Dictionary.h:61
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
A class that has any number of children that also feed into the log. Can be used to easily collect lo...
Definition LogManager.h:14
void writeToFile(BinaryFile &file, uint01 minimum_log_level, CompressionMode mode=CompressionMode::e_default_compression)
void addLog(const String &name, ProgressInfo *info)
bool hasLog(const String &log_name) const
const Dictionary< String, ProgressInfo * > & logs()
virtual bool addMessage(const TranslatedString &, uint01=10) override
virtual bool addMessage(const LogMessage &) override
void logStartupInformation(const String &log) const
MoveMode
Definition LogManager.h:17
Dictionary< String, ProgressInfo * > m_logs
Definition LogManager.h:43
void removeStream(LogStream *stream) override
virtual bool setProgress(fltp04) override
virtual void allowCancel(bool) override
virtual void setCancelRequest(bool) override
void addStream(LogStream *stream, bool add_all) override
File m_default_ascii_log_path
Definition LogManager.h:46
Dictionary< String, AsciiFileOutputStream * > m_ascii_streams
Definition LogManager.h:45
virtual bool addMessage(const char *const, uint01=10) override
void setDefaultAsciiLogPath(const File &file, MoveMode mode)
Buffer< LogStream * > m_streams
Definition LogManager.h:44
ProgressInfo * defaultLog() const
Definition LogManager.h:24
ProgressInfo * getLog(const String &log_name) const
virtual bool addMessage(const String &, uint01=10) override
void readFromFile(BinaryFile &file)
A class that allows for specific log information to be conveyed to a ProgressInfo object including in...
Definition LogMessage.h:44
A class that listens to a log object and processes the updates in a specified way....
Definition LogStream.h:46
A light-weight base class for Log that allows processes to update, without the need for additional in...
Definition ProgressInfo.hpp:48
The core String class for the NDEVR API.
Definition String.h:69
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
Definition ACIColor.h:37
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
Definition BaseValues.hpp:127
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
CompressionMode
Logical information about the type of compression implemented or requested.
Definition Compressor.h:16