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


Creates a Logger instance.


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.

uint32_t Logger::indentation(uint32_t type) constnoexcept

Returns indentation of type, see FormatOptions::IndentationType.

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.