Public Types | Static Public Member Functions | Static Public Attributes | Static Private Attributes | List of all members
ov_core::Printer Class Reference

Printer for open_vins that allows for various levels of printing to be done. More...

#include <print.h>

Public Types

enum  PrintLevel {
  ALL = 0, DEBUG = 1, INFO = 2, WARNING = 3,
  ERROR = 4, SILENT = 5
}
 The different print levels possible. More...
 

Static Public Member Functions

static void debugPrint (PrintLevel level, const char location[], const char line[], const char *format,...)
 The print function that prints to stdout. More...
 
static void setPrintLevel (const std::string &level)
 Set the print level to use for all future printing to stdout. More...
 
static void setPrintLevel (PrintLevel level)
 Set the print level to use for all future printing to stdout. More...
 

Static Public Attributes

static PrintLevel current_print_level = PrintLevel::INFO
 The current print level. More...
 

Static Private Attributes

static constexpr uint32_t MAX_FILE_PATH_LEGTH = 30
 The max length for the file path. This is to avoid very long file paths from. More...
 

Detailed Description

Printer for open_vins that allows for various levels of printing to be done.

To set the global verbosity level one can do the following:

ov_core::Printer::setPrintLevel(ov_core::Printer::PrintLevel::WARNING);

Definition at line 42 of file print.h.

Member Enumeration Documentation

◆ PrintLevel

The different print levels possible.

  • PrintLevel::ALL : All PRINT_XXXX will output to the console
  • PrintLevel::DEBUG : "DEBUG", "INFO", "WARNING" and "ERROR" will be printed. "ALL" will be silenced
  • PrintLevel::INFO : "INFO", "WARNING" and "ERROR" will be printed. "ALL" and "DEBUG" will be silenced
  • PrintLevel::WARNING : "WARNING" and "ERROR" will be printed. "ALL", "DEBUG" and "INFO" will be silenced
  • PrintLevel::ERROR : Only "ERROR" will be printed. All the rest are silenced
  • PrintLevel::SILENT : All PRINT_XXXX will be silenced.
Enumerator
ALL 
DEBUG 
INFO 
WARNING 
ERROR 
SILENT 

Definition at line 54 of file print.h.

Member Function Documentation

◆ debugPrint()

void Printer::debugPrint ( PrintLevel  level,
const char  location[],
const char  line[],
const char *  format,
  ... 
)
static

The print function that prints to stdout.

Parameters
levelthe print level for this print call
locationthe location the print was made from
linethe line the print was made from
formatThe printf format

Definition at line 80 of file print.cpp.

◆ setPrintLevel() [1/2]

void Printer::setPrintLevel ( const std::string &  level)
static

Set the print level to use for all future printing to stdout.

Parameters
levelThe debug level to use

Definition at line 29 of file print.cpp.

◆ setPrintLevel() [2/2]

void Printer::setPrintLevel ( PrintLevel  level)
static

Set the print level to use for all future printing to stdout.

Parameters
levelThe debug level to use

Definition at line 49 of file print.cpp.

Member Data Documentation

◆ current_print_level

Printer::PrintLevel Printer::current_print_level = PrintLevel::INFO
static

The current print level.

Definition at line 78 of file print.h.

◆ MAX_FILE_PATH_LEGTH

constexpr uint32_t ov_core::Printer::MAX_FILE_PATH_LEGTH = 30
staticconstexprprivate

The max length for the file path. This is to avoid very long file paths from.

Definition at line 82 of file print.h.


The documentation for this class was generated from the following files:
ov_core::Printer::setPrintLevel
static void setPrintLevel(const std::string &level)
Set the print level to use for all future printing to stdout.
Definition: print.cpp:29


ov_core
Author(s): Patrick Geneva , Kevin Eckenhoff , Guoquan Huang
autogenerated on Mon Dec 16 2024 03:06:46