25#ifndef _SOURCE_TFLOGGER_H_
26#define _SOURCE_TFLOGGER_H_
35 class CAPI_EXPORT LoggingBuffer
38 LoggingBuffer(
int level,
const char* func,
const char* file,
int line);
51 std::stringstream buffer;
73 LOG_OUTPUTSTREAM_CHANGED,
78 typedef HRESULT (*LoggerCallback)(LogEvent, std::ostream *);
184 static void setCallback(LoggerCallback);
190#define TF_Log(level) \
191 if (level > TissueForge::Logger::getLevel()) { ; } \
192 else TissueForge::LoggingBuffer(level, TF_FUNCTION, __FILE__, __LINE__).stream()
static std::string getCurrentLevelAsString()
get the textural form of the current logging level.
static LogLevel stringToLevel(const std::string &str)
static void log(LogLevel level, const std::string &msg)
logs a message to the log.
static void setConsoleStream(std::ostream *os)
static std::string levelToString(int level)
static void setLevel(int level=LOG_CURRENT)
Set the Level objectsets the logging level to one a value from Logger::Level.
static int getLevel()
Get the Level objectget the current logging level.
static void disableFileLogging()
turns off file logging, but has no effect on console logging.
static void disableLogging()
Suppresses all logging output.
static void enableFileLogging(const std::string &fileName="", int level=LOG_CURRENT)
turns on file logging to the given file as the given level.
static void disableConsoleLogging()
stops logging to the console, but file logging may continue.
static void enableConsoleLogging(int level=LOG_CURRENT)
turns on console logging at the given level.
static std::string getFileName()
Get the File Name objectget the name of the currently used log file.
Include Python header, disable linking to pythonX_d.lib on Windows in debug mode.
Definition tfAngleConfig.h:26
LogLevel
Definition tfLogger.h:59
@ LOG_INFORMATION
An informational message, usually denoting the successful completion of an operation.
Definition tfLogger.h:66
@ LOG_CRITICAL
A critical error. The application might not be able to continue running successfully.
Definition tfLogger.h:62
@ LOG_DEBUG
A debugging message.
Definition tfLogger.h:67
@ LOG_FATAL
A fatal error. The application will most likely terminate. This is the highest priority.
Definition tfLogger.h:61
@ LOG_TRACE
A tracing message. This is the lowest priority.
Definition tfLogger.h:68
@ LOG_WARNING
A warning. An operation completed with an unexpected result.
Definition tfLogger.h:64
@ LOG_CURRENT
Use the current level – don't change the level from what it is.
Definition tfLogger.h:60
@ LOG_NOTICE
A notice, which is an information with just a higher priority.
Definition tfLogger.h:65
@ LOG_ERROR
An error. An operation did not complete successfully, but the application as a whole is not affected.
Definition tfLogger.h:63
int32_t HRESULT
Definition tf_port.h:255