VCV Rack API v2
Loading...
Searching...
No Matches
logger.hpp File Reference
#include <common.hpp>
Include dependency graph for logger.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  rack
 Root namespace for the Rack API.
 
namespace  rack::logger
 Logs messages to a file or the terminal.
 

Macros

#define DEBUG(format, ...)
 Example usage:
 
#define INFO(format, ...)
 
#define WARN(format, ...)
 
#define FATAL(format, ...)
 

Enumerations

enum  rack::logger::Level { rack::logger::DEBUG_LEVEL , rack::logger::INFO_LEVEL , rack::logger::WARN_LEVEL , rack::logger::FATAL_LEVEL }
 

Functions

PRIVATE bool rack::logger::init ()
 Returns whether logger was successfully initialized.
 
PRIVATE void rack::logger::destroy ()
 
 rack::logger::__attribute__ ((format(printf, 5, 6))) void log(Level level
 Do not use this function directly.
 
const char int const char const char PRIVATE bool rack::logger::wasTruncated ()
 Returns whether the last log file failed to end properly, due to a possible crash.
 

Variables

std::string rack::logger::logPath
 
const char * rack::logger::filename
 
const char int rack::logger::line
 
const char int const char * rack::logger::func
 
const char int const char const char * rack::logger::format
 

Macro Definition Documentation

◆ DEBUG

#define DEBUG ( format,
... )
Value:
rack::logger::log(rack::logger::DEBUG_LEVEL, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)
@ DEBUG_LEVEL
Definition logger.hpp:28

Example usage:

DEBUG("error: %d", errno);

will print something like

[0.123 debug myfile.cpp:45] error: 67

◆ INFO

#define INFO ( format,
... )
Value:
rack::logger::log(rack::logger::INFO_LEVEL, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)
@ INFO_LEVEL
Definition logger.hpp:29

◆ WARN

#define WARN ( format,
... )
Value:
rack::logger::log(rack::logger::WARN_LEVEL, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)
@ WARN_LEVEL
Definition logger.hpp:30

◆ FATAL

#define FATAL ( format,
... )
Value:
rack::logger::log(rack::logger::FATAL_LEVEL, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)
@ FATAL_LEVEL
Definition logger.hpp:31