Open3D (C++ API)  0.17.0
Data Structures | Public Member Functions | Static Public Member Functions
open3d::utility::Logger Class Reference

Logger class should be used as a global singleton object (GetInstance()). More...

#include <Logging.h>

Data Structures

struct  Impl
 

Public Member Functions

 Logger (Logger const &)=delete
 
void operator= (Logger const &)=delete
 
void SetPrintFunction (std::function< void(const std::string &)> print_fcn)
 
void ResetPrintFunction ()
 Reset the print function to the default one (print to console). More...
 
const std::function< void(const std::string &)> GetPrintFunction ()
 Get the print function used by the Logger. More...
 
void SetVerbosityLevel (VerbosityLevel verbosity_level)
 
VerbosityLevel GetVerbosityLevel () const
 Get global verbosity level of Open3D. More...
 

Static Public Member Functions

static LoggerGetInstance ()
 Get Logger global singleton instance. More...
 
template<typename... Args>
static void LogError_ (const char *file, int line, const char *function, const char *format, Args &&... args)
 
template<typename... Args>
static void LogWarning_ (const char *file, int line, const char *function, const char *format, Args &&... args)
 
template<typename... Args>
static void LogInfo_ (const char *file, int line, const char *function, const char *format, Args &&... args)
 
template<typename... Args>
static void LogDebug_ (const char *file, int line, const char *function, const char *format, Args &&... args)
 

Detailed Description

Logger class should be used as a global singleton object (GetInstance()).

Constructor & Destructor Documentation

◆ Logger()

open3d::utility::Logger::Logger ( Logger const &  )
delete

Member Function Documentation

◆ GetInstance()

Logger & open3d::utility::Logger::GetInstance ( )
static

Get Logger global singleton instance.

◆ GetPrintFunction()

const std::function< void(const std::string &)> open3d::utility::Logger::GetPrintFunction ( )

Get the print function used by the Logger.

◆ GetVerbosityLevel()

VerbosityLevel open3d::utility::Logger::GetVerbosityLevel ( ) const

Get global verbosity level of Open3D.

◆ LogDebug_()

template<typename... Args>
static void open3d::utility::Logger::LogDebug_ ( const char *  file,
int  line,
const char *  function,
const char *  format,
Args &&...  args 
)
inlinestatic

◆ LogError_()

template<typename... Args>
static void open3d::utility::Logger::LogError_ ( const char *  file,
int  line,
const char *  function,
const char *  format,
Args &&...  args 
)
inlinestatic

◆ LogInfo_()

template<typename... Args>
static void open3d::utility::Logger::LogInfo_ ( const char *  file,
int  line,
const char *  function,
const char *  format,
Args &&...  args 
)
inlinestatic

◆ LogWarning_()

template<typename... Args>
static void open3d::utility::Logger::LogWarning_ ( const char *  file,
int  line,
const char *  function,
const char *  format,
Args &&...  args 
)
inlinestatic

◆ operator=()

void open3d::utility::Logger::operator= ( Logger const &  )
delete

◆ ResetPrintFunction()

void open3d::utility::Logger::ResetPrintFunction ( )

Reset the print function to the default one (print to console).

◆ SetPrintFunction()

void open3d::utility::Logger::SetPrintFunction ( std::function< void(const std::string &)>  print_fcn)

Overwrite the default print function, this is useful when you want to redirect prints rather than printing to stdout. For example, in Open3D's python binding, the default print function is replaced with py::print().

Parameters
print_fcnThe function for printing. It should take a string input and returns nothing.

◆ SetVerbosityLevel()

void open3d::utility::Logger::SetVerbosityLevel ( VerbosityLevel  verbosity_level)

Set global verbosity level of Open3D.

Parameters
verbosity_levelMessages with equal or less than verbosity_level verbosity will be printed.

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