C3D Toolkit  Kernel - 118060, Vision - 2.15.0.1825

Logging switch in a scope. More...

#include <tool_log.h>

Public Member Functions

 LogHelper (bool enable, const TCHAR *file, size_t id=SYS_MAX_T)
 Constructor with parameters. More...
 

Detailed Description

Logging switch in a scope.

Helper class for the logging in the scope. The logging starts in the constructor and ends in the destructor. If a file name was defined in the constructor, then before ending the logging, the destructor writes the collected log to the file. Example of use: { Start logging, the log will be written to the file myLogFile.log. c3d::LogHelper log( true, _T("myLogFile") );

Put a specified string to the log. LOG_MSG( _T("My formatted message") ); ... Format a log line and put it to the log using the operator << Logger::Endl. c3d::Logger::Get() << _T("Value ") << k << Logger::Endl; ... } // When leaving the code scope the logging stops and the log is written to the file.

Constructor & Destructor Documentation

◆ LogHelper()

c3d::LogHelper::LogHelper ( bool  enable,
const TCHAR *  file,
size_t  id = SYS_MAX_T 
)

Constructor with parameters.

Parameters
enable- Whether to start logging.
file- The name of the log file.
id- An index to be added to the name of the log file. If id == SYS_MAX_T, then the index will not be added.

The documentation for this class was generated from the following file: