asmjit::Logger Class Referenceabstract

Logging interface.

This class can be inherited and reimplemented to fit into your own logging needs. When reimplementing a logger use Logger::_log() method to log customize the output.

There are two Logger implementations offered by AsmJit:

Public Members

Member Functions

Construction & Destruction
Format Options
Logging Interface

Constructor & Destructor Documentation

Logger::Logger()noexcept

Creates a Logger instance.

Logger::~Logger()virtualnoexcept

Destroys the Logger instance.

Member Function Documentation

FormatOptions& Logger::options()noexcept[1/2]

Returns FormatOptions of this logger.

const FormatOptions& Logger::options() constnoexcept[2/2]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

uint32_t Logger::flags() constnoexcept

Returns formatting flags, see FormatOptions::Flags.

bool Logger::hasFlag(uint32_t flag) constnoexcept

Tests whether the logger has the given flag enabled.

void Logger::setFlags(uint32_t flags)noexcept

Sets formatting flags to flags, see FormatOptions::Flags.

void Logger::addFlags(uint32_t flags)noexcept

Enables the given formatting flags, see FormatOptions::Flags.

void Logger::clearFlags(uint32_t flags)noexcept

Disables the given formatting flags, see FormatOptions::Flags.

uint32_t Logger::indentation(uint32_t type) constnoexcept

Returns indentation of type, see FormatOptions::IndentationType.

void Logger::setIndentation(uint32_t type, uint32_t n)noexcept

Sets indentation of the given indentation type to n spaces, see FormatOptions::IndentationType.

void Logger::resetIndentation(uint32_t type)noexcept

Resets indentation of the given indentation type to 0 spaces.

Error Logger::_log(const char* data, size_t size)pure virtualnoexcept

Logs str - must be reimplemented.

The function can accept either a null terminated string if size is SIZE_MAX or a non-null terminated string of the given size. The function cannot assume that the data is null terminated and must handle non-null terminated inputs.

Implemented in asmjit::StringLogger, and asmjit::FileLogger.

Error Logger::log(const char* data, size_t size = SIZE_MAX)noexcept[1/2]

Logs string str, which is either null terminated or having size size.

Error Logger::log(const String& str)noexcept[2/2]

Logs content of a string str.

Error Logger::logf(const char* fmt, ...)noexcept

Formats the message by using snprintf() and then passes the formatted string to _log().

Error Logger::logv(const char* fmt, va_list ap)noexcept

Formats the message by using vsnprintf() and then passes the formatted string to _log().

Error Logger::logBinary(const void* data, size_t size)noexcept

Logs binary data of the given size.

Member Data Documentation

FormatOptions Logger::_options

Format options.