Turi Create  4.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Logging Utilities

Modules

 Logging Assertions
 Assertions.
 
 Log Levels
 Log Levels.
 
 Logging Statements
 Global Logging Statements.
 

Classes

class  log_level_setter
 
class  file_logger
 

Macros

#define OUTPUTLEVEL   LOG_DEBUG
 

Functions

void turi::begin_log_rotation (std::string log_file_name, size_t log_interval, size_t truncate_limit)
 

Detailed Description

Macro Definition Documentation

◆ OUTPUTLEVEL

#define OUTPUTLEVEL   LOG_DEBUG

The minimum level to logger at. Set to LOG_NONE OUTPUTLEVEL to LOG_NONE to disable logging

Definition at line 113 of file logger.hpp.

Function Documentation

◆ begin_log_rotation()

void turi::begin_log_rotation ( std::string  log_file_name,
size_t  log_interval,
size_t  truncate_limit 
)

Sets up log rotation. The basic procedure is that it will generate files of the form

*   [log_file_name].0
*   [log_file_name].1
*   [log_file_name].2
*   etc.
* 

When truncate_limit is set, a maximum number of files is maintained. Beyond which, older files are deleted.

A symlink [log_file_name].current is also created which always points to the most recent log file.

If log rotation has already been set up, this will stop the the log rotation and begin a new one.

Not safe for concurrent use.

Parameters
log_file_nameThe prefix to output to. Logs will emit to [log_file_name].0, [log_file_name].1, etc.
log_intervalThe number of seconds between rotations
truncate_limitThe maximum number of files to maintain. Must be >= 1