Logging module
Butano logging system.
It allows to print information on the console of multiple emulators.
It can be enabled or disabled by overloading the definition of BN_
It supports printing on only one emulator at once. The supported emulator can be changed by overloading the definition of BN_
Files
- file bn_config_log.h
- file bn_log.h
- file bn_log_backend.h
- file bn_log_level.h
Enums
Functions
- void log(const istring_base& message)
- Prints in one line of text the given message with the default log level (bn::
log_level:: WARN). - void log(log_level level, const istring_base& message)
- Prints in one line of text the given message.
Defines
- #define BN_CFG_LOG_ENABLED
- #define BN_CFG_LOG_BACKEND
- #define BN_CFG_LOG_MAX_SIZE
- #define BN_LOG(...)
- #define BN_LOG_LEVEL(level, ...)
- #define BN_LOG_BACKEND_MGBA
- #define BN_LOG_BACKEND_NOCASHGBA
- #define BN_LOG_BACKEND_VBA
Enum documentation
Function documentation
void log(const istring_base& message)
#include <bn_log.h>
Prints in one line of text the given message with the default log level (bn::
void log(log_level level,
const istring_base& message)
#include <bn_log.h>
Prints in one line of text the given message.
Parameters | |
---|---|
level | Message level. |
message | Message to print. |
Define documentation
#define BN_CFG_LOG_ENABLED
#include <bn_config_log.h>
Specifies if logging is enabled or not.
#define BN_CFG_LOG_BACKEND
#include <bn_config_log.h>
Specifies the log backend to use.
Values not specified in BN_LOG_BACKEND_* macros are not allowed.
#define BN_CFG_LOG_MAX_SIZE
#include <bn_config_log.h>
Specifies the maximum number of characters that can be logged with one BN_LOG call.
#define BN_LOG(...)
#include <bn_log.h>
Prints in one line of text the representation of the given parameters with the default log level (bn::
Example:
BN_LOG("Invalid integer: ", integer);
Custom parameter types are supported by overloading bn::ostringstream::operator<<.
Example:
bn::ostringstream& operator<<(bn::ostringstream& stream, const custom_type& custom_value) { stream.append("custom_type: "); stream.append(custom_value.data); return stream; }
#define BN_LOG_LEVEL(level,
...)
#include <bn_log.h>
Prints in one line of text the representation of the given parameters with the specified log level.
Example:
BN_LOG_LEVEL(bn::log_level::ERROR, "Invalid integer: ", integer);
Custom parameter types are supported by overloading bn::ostringstream::operator<<.
Example:
bn::ostringstream& operator<<(bn::ostringstream& stream, const custom_type& custom_value) { stream.append("custom_type: "); stream.append(custom_value.data); return stream; }
#define BN_LOG_BACKEND_MGBA
#include <bn_log_backend.h>
mGBA log backend.
It also works with NanoBoyAdvance and Mesen.
#define BN_LOG_BACKEND_NOCASHGBA
#include <bn_log_backend.h>
No$gba log backend.
#define BN_LOG_BACKEND_VBA
#include <bn_log_backend.h>
VisualBoyAdvance log backend.
It crashes on hardware and on other emulators!