Report#

Fully qualified name: usd_optimize::Report

class Report#

Report Object.

Convenience class to maintain a handle to an output file and allow appending log information to it. It’s main purpose is to allow writing out easily parseable data that something (eg a UI) can read and break down.

Public Functions

explicit Report(const std::string &path)#

Constructor.

Create an uninitialized report, intended to be saved at path. Call initialize before attempting to log messages.

Parameters:

path – The output filename to use

Report(const Report &other) = delete#

Copy constructor.

~Report()#

Destructor.

bool initialize()#

Initialize the report for use.

This function must be called before calling log, otherwise the output handle will not be open.

Returns:

Success

void log(
LogLevel level,
const std::string &category,
const std::string &message,
bool multiline = false,
)#

Log a message.

Allows logging a message based on severity, with an arbitrary category attached. This category is intended to allow tools that read the log to provide filtering options for types of messages.

The multiline flag allows a message to be wrapped by begin/end markers to enable explicit parsing of multiline/complex strings, eg bulk output.

Parameters:
  • level – The logging level

  • category – An arbitrary category to allow filtering messages

  • message – The log message

  • multiline – Whether the message should be treated as multiline