.. index:: pair: class; EE::System::Log .. _doxid-class_e_e_1_1_system_1_1_log: class EE::System::Log ===================== .. toctree:: :hidden: Overview ~~~~~~~~ Global log file. The engine will log everything in this file. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class Log: protected :ref:`EE::System::Mutex` { public: // construction virtual :target:`~Log`(); // methods static std::unordered_map`> :target:`getMapFlag`(); static constexpr :ref:`LogLevel` :target:`getDefaultLogLevel`(); static Log* :target:`create`(const std::string& logPath, const :ref:`LogLevel`& level, bool stdOutLog, bool liveWrite); static Log* :target:`create`(const :ref:`LogLevel`& level, bool stdOutLog, bool liveWrite); static void :target:`debug`(const std::string_view& text); static void :target:`info`(const std::string_view& text); static void :target:`notice`(const std::string_view& text); static void :target:`warning`(const std::string_view& text); static void :target:`error`(const std::string_view& text); static void :target:`critical`(const std::string_view& text); static void :target:`assertLog`(const std::string_view& text); template static void :target:`debug`(const char* format, Args&&... args); template static void :target:`info`(const char* format, Args&&... args); template static void :target:`notice`(const char* format, Args&&... args); template static void :target:`warning`(const char* format, Args&&... args); template static void :target:`error`(const char* format, Args&&... args); template static void :target:`critical`(const char* format, Args&&... args); template static void :target:`assertLog`(const char* format, Args&&... args); void :ref:`save`(const std::string& filepath = ""); void :ref:`write`(const std::string_view& text); void :ref:`write`(const :ref:`LogLevel`& level, const std::string_view& text); void :ref:`writel`(const std::string_view& text); void :ref:`writel`(const :ref:`LogLevel`& level, const std::string_view& text); template void :ref:`writef`(const :ref:`LogLevel`& level, std::string_view format, Args&&... args); template void :ref:`writef`(std::string_view format, Args&&... args); const std::string& :ref:`getBuffer`() const; const bool& :ref:`isLoggingToStdOut`() const; void :ref:`setLogToStdOut`(const bool& output); const bool& :ref:`isLiveWrite`() const; void :ref:`setLiveWrite`(const bool& lw); void :ref:`addLogReader`(:ref:`LogReaderInterface`* reader); void :ref:`removeLogReader`(:ref:`LogReaderInterface`* reader); const :ref:`LogLevel`& :ref:`getLogLevelThreshold`() const; void :ref:`setLogLevelThreshold`(const :ref:`LogLevel`& logLevelThreshold); const std::string& :ref:`getFilePath`() const; void :ref:`setFilePath`(const std::string& filePath); bool :ref:`getKeepLog`() const; void :ref:`setKeepLog`(bool keepLog); }; Inherited Members ----------------- .. ref-code-block:: cpp :class: doxyrest-overview-inherited-code-block public: // methods void :ref:`lock`(); void :ref:`unlock`(); bool :ref:`tryLock`(); .. _details-class_e_e_1_1_system_1_1_log: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Global log file. The engine will log everything in this file. Methods ------- .. index:: pair: function; save .. _doxid-class_e_e_1_1_system_1_1_log_1a4d6e833b9c562dfab35891d01ebccf35: .. ref-code-block:: cpp :class: doxyrest-title-code-block void save(const std::string& filepath = "") Indicates that the log must be writed to a file when the :ref:`Log ` instance is closed. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - filepath - The path to the file to write the log. .. index:: pair: function; write .. _doxid-class_e_e_1_1_system_1_1_log_1ab7fe1b8096a4b31512a2e4af4572d7d8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void write(const std::string_view& text) Writes the text to the log. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - text - The text to write .. index:: pair: function; write .. _doxid-class_e_e_1_1_system_1_1_log_1a82c8f4f083579b6f7bc055babc2ce899: .. ref-code-block:: cpp :class: doxyrest-title-code-block void write(const :ref:`LogLevel`& level, const std::string_view& text) Writes the text to the log with a log level. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - level - The log level that will try to write. * - text - The text to write .. index:: pair: function; writel .. _doxid-class_e_e_1_1_system_1_1_log_1ad4cb64a3aa3aeb016ac175c0b1975e42: .. ref-code-block:: cpp :class: doxyrest-title-code-block void writel(const std::string_view& text) Writes the text to the log and appends a new line character at the end. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - text - The text to write .. index:: pair: function; writel .. _doxid-class_e_e_1_1_system_1_1_log_1ac8f465ee07a74f73546819b16e629d59: .. ref-code-block:: cpp :class: doxyrest-title-code-block void writel(const :ref:`LogLevel`& level, const std::string_view& text) Writes the text to the log and appends a new line character at the end with a log level. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - levelThe - log level that will try to write. * - text - The text to write .. index:: pair: function; writef .. _doxid-class_e_e_1_1_system_1_1_log_1a2ef2fba3bf9ee00d82f0963f19790012: .. ref-code-block:: cpp :class: doxyrest-title-code-block template void writef(const :ref:`LogLevel`& level, std::string_view format, Args&&... args) Writes a formated string to the log with a log level. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - level - The log level that will try to write. * - format - The Text format. .. index:: pair: function; writef .. _doxid-class_e_e_1_1_system_1_1_log_1a7f6f28b80fe4b6c82e5d79282c410096: .. ref-code-block:: cpp :class: doxyrest-title-code-block template void writef(std::string_view format, Args&&... args) Writes a formated string to the log. .. index:: pair: function; getBuffer .. _doxid-class_e_e_1_1_system_1_1_log_1a5c3b9783f79f762a7023eb60178ed17f: .. ref-code-block:: cpp :class: doxyrest-title-code-block const std::string& getBuffer() const .. rubric:: Returns: A reference of the current writed log. .. index:: pair: function; isLoggingToStdOut .. _doxid-class_e_e_1_1_system_1_1_log_1a0d39e3cae40f3aae1a227293b265daf3: .. ref-code-block:: cpp :class: doxyrest-title-code-block const bool& isLoggingToStdOut() const .. rubric:: Returns: If the log Writes are outputed to stdout. .. index:: pair: function; setLogToStdOut .. _doxid-class_e_e_1_1_system_1_1_log_1a3d25b2006c42ef48bebf7fb4eb4bd75e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setLogToStdOut(const bool& output) Enabled or disables to output the Writes to stdout. .. index:: pair: function; isLiveWrite .. _doxid-class_e_e_1_1_system_1_1_log_1aa6026d5131dd6661305a00d75cac094d: .. ref-code-block:: cpp :class: doxyrest-title-code-block const bool& isLiveWrite() const .. rubric:: Returns: If the file is forced to flush the data on every Write call. .. index:: pair: function; setLiveWrite .. _doxid-class_e_e_1_1_system_1_1_log_1a2c4f6ccd91e0b3213137a5050473344c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setLiveWrite(const bool& lw) Activate or deactivate to flush the writed data to the log on every Write call. .. index:: pair: function; addLogReader .. _doxid-class_e_e_1_1_system_1_1_log_1a5f5a5fcbdcd89e27c416529140e0cf46: .. ref-code-block:: cpp :class: doxyrest-title-code-block void addLogReader(:ref:`LogReaderInterface`* reader) Adds a reader interface. The reader interface is used to the informed for every writed text to the log. .. index:: pair: function; removeLogReader .. _doxid-class_e_e_1_1_system_1_1_log_1ae9bd6bf2e2a4ba42eb5c7bc6430bafe6: .. ref-code-block:: cpp :class: doxyrest-title-code-block void removeLogReader(:ref:`LogReaderInterface`* reader) Removes the reader interface. .. index:: pair: function; getLogLevelThreshold .. _doxid-class_e_e_1_1_system_1_1_log_1a92280f1a5dc6c0f1bbee6c624e4bdb5a: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`LogLevel`& getLogLevelThreshold() const .. rubric:: Returns: The log level threshold. .. index:: pair: function; setLogLevelThreshold .. _doxid-class_e_e_1_1_system_1_1_log_1a89f034faa8f3413e0f3732fab9af6c7a: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setLogLevelThreshold(const :ref:`LogLevel`& logLevelThreshold) Sets the log level threshold. This is the minimum level that message will actually be logged. .. index:: pair: function; getFilePath .. _doxid-class_e_e_1_1_system_1_1_log_1a1438816a6292e55134e98ba93d6e3f6d: .. ref-code-block:: cpp :class: doxyrest-title-code-block const std::string& getFilePath() const .. rubric:: Returns: The file path of the log file (if any). .. index:: pair: function; setFilePath .. _doxid-class_e_e_1_1_system_1_1_log_1a02637245824797c4d2bba74c12b1c15c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setFilePath(const std::string& filePath) Sets the file path of the log file. .. index:: pair: function; getKeepLog .. _doxid-class_e_e_1_1_system_1_1_log_1ab388be3bdfd0ffab50f83a95ad58a008: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool getKeepLog() const .. rubric:: Returns: True if the logs are being buffered in memory .. index:: pair: function; setKeepLog .. _doxid-class_e_e_1_1_system_1_1_log_1a9bb9126fe109f56e15cc5eaec4c6b194: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setKeepLog(bool keepLog) Enable/Disable to keep a copy of the logs into memory (disabled by default)