asmjit::Logger Class Reference
Inheritance diagram for asmjit::Logger:
asmjit::FileLogger asmjit::StringLogger

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.

void Logger::setOptions(const FormatOptions& options)noexcept◆ 

Sets formatting options of this Logger to options.

void Logger::resetOptions()noexcept◆ 

Resets formatting options of this Logger to defaults.

FormatFlags Logger::flags() constnoexcept◆ 

Returns formatting flags.

bool Logger::hasFlag(FormatFlags flag) constnoexcept◆ 

Tests whether the logger has the given flag enabled.

void Logger::setFlags(FormatFlags flags)noexcept◆ 

Sets formatting flags to flags.

void Logger::addFlags(FormatFlags flags)noexcept◆ 

Enables the given formatting flags.

void Logger::clearFlags(FormatFlags flags)noexcept◆ 

Disables the given formatting flags.

uint32_t Logger::indentation(FormatIndentationGroup type) constnoexcept◆ 

Returns indentation of a given indentation group.

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

Sets indentation of the given indentation group to n spaces.

void Logger::resetIndentation(FormatIndentationGroup type)noexcept◆ 

Resets indentation of the given indentation group to 0 spaces.

size_t Logger::padding(FormatPaddingGroup type) constnoexcept◆ 

Returns padding of a given padding group.

void Logger::setPadding(FormatPaddingGroup type, uint32_t n)noexcept◆ 

Sets padding of a given padding group to n.

void Logger::resetPadding(FormatPaddingGroup type)noexcept◆ 

Resets padding of a given padding group to 0, which means that a default will be used.

Error Logger::_log(const char* data, size_t size)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.

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

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().

Member Data Documentation

FormatOptions Logger::_options◆ 

Format options.