Logger#

Fully qualified name: isaacsim::common::logging::Logger

class Logger#

Lightweight logger with one immutable Carbonite channel.

Construction caches channel state without selecting or initializing a logging backend.

Public Functions

explicit Logger(std::string_view channel)#

Construct a logger for a non-empty channel.

Parameters:

channel – [in] Channel attached to every record submitted by this logger.

Throws:

std::invalid_argument – If channel is empty.

~Logger()#

Destroy the logger without flushing process-wide logging state.

Logger(const Logger &other) = delete#

Prevent copying a logger and its channel registration.

Parameters:

other – [in] Logger that would be copied.

Logger &operator=(const Logger &other) = delete#

Prevent assigning a copied logger.

Parameters:

other – [in] Logger that would be copied.

Returns:

Reference to this logger.

Logger(Logger &&other) = delete#

Prevent moving a logger and its channel registration.

Parameters:

other – [in] Logger that would be moved.

Logger &operator=(Logger &&other) = delete#

Prevent assigning a moved logger.

Parameters:

other – [in] Logger that would be moved.

Returns:

Reference to this logger.

std::string_view getChannel() const noexcept#

Return this logger’s immutable channel.

Returns:

Channel attached to the logger.

bool isEnabled(LogLevel severity) const noexcept#

Return whether the backend currently admits a severity for this logger’s channel.

Parameters:

severity – [in] Severity to query.

Returns:

true when a record at the severity is currently admitted.

void log(
LogLevel severity,
std::string_view message,
SourceLocation location = {},
) const noexcept#

Submit an already formatted message.

Parameters:
  • severity – [in] Severity assigned to the record.

  • message – [in] Message to submit.

  • location – [in] Borrowed source metadata.

template<typename Format, typename ...Args>
inline void logFormatted(
LogLevel severity,
SourceLocation location,
const Format &format,
Args&&... args,
) const noexcept#

Format a message with {fmt} and submit it without a second message copy.

Template Parameters:
  • Format – Format-string type accepted by {fmt}.

  • Args – Types of values referenced by the format string.

Parameters:
  • severity – [in] Severity assigned to the record.

  • location – [in] Borrowed source metadata.

  • format – [in] Format string.

  • args – [in] Values referenced by format.

void report(
std::string_view message,
SourceLocation location = {},
) const noexcept#

Print one channel-prefixed line to standard output and submit the message at INFO severity.

The standard-output line is [channel] message.

Parameters:
  • message – [in] Message to print and submit.

  • location – [in] Borrowed source metadata.

template<typename Format, typename ...Args>
inline void reportFormatted(
SourceLocation location,
const Format &format,
Args&&... args,
) const noexcept#

Format a report with {fmt}, print it after the channel prefix, and submit it at INFO severity.

Template Parameters:
  • Format – Format-string type accepted by {fmt}.

  • Args – Types of values referenced by the format string.

Parameters:
  • location – [in] Borrowed source metadata.

  • format – [in] Format string.

  • args – [in] Values referenced by format.