VCV Rack API v2
Loading...
Searching...
No Matches
logger.hpp
Go to the documentation of this file.
1#pragma once
2#include <common.hpp>
3
4
13#define DEBUG(format, ...) rack::logger::log(rack::logger::DEBUG_LEVEL, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)
14#define INFO(format, ...) rack::logger::log(rack::logger::INFO_LEVEL, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)
15#define WARN(format, ...) rack::logger::log(rack::logger::WARN_LEVEL, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)
16#define FATAL(format, ...) rack::logger::log(rack::logger::FATAL_LEVEL, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)
17
18
19namespace rack {
21namespace logger {
22
23
24extern std::string logPath;
25
26
33
40__attribute__((format(printf, 5, 6)))
41void log(Level level, const char* filename, int line, const char* func, const char* format, ...);
45
46
47} // namespace logger
48} // namespace rack
#define PRIVATE
Attribute for private functions not intended to be called by plugins.
Definition common.hpp:32
const char int const char const char PRIVATE bool wasTruncated()
Returns whether the last log file failed to end properly, due to a possible crash.
const char * filename
Definition logger.hpp:41
Level
Definition logger.hpp:27
@ WARN_LEVEL
Definition logger.hpp:30
@ DEBUG_LEVEL
Definition logger.hpp:28
@ FATAL_LEVEL
Definition logger.hpp:31
@ INFO_LEVEL
Definition logger.hpp:29
__attribute__((format(printf, 5, 6))) void log(Level level
Do not use this function directly.
const char int const char const char * format
Definition logger.hpp:41
std::string logPath
PRIVATE bool init()
Returns whether logger was successfully initialized.
PRIVATE void destroy()
const char int const char * func
Definition logger.hpp:41
const char int line
Definition logger.hpp:41
Root namespace for the Rack API.
Definition AudioDisplay.hpp:9