omni::structuredlog::IStructuredLogFromILog

Defined in omni/structuredlog/IStructuredLogFromILog.h

class IStructuredLogFromILog : public omni::core::Generated<omni::structuredlog::IStructuredLogFromILog_abi>

This interface controls the ability to send Carbonite and Omniverse logging through the structured log system.

The output is equivalent to the standard logging output, except that it is in JSON, so it will be easier for programs to consume.

The default state of structured log logging is off, but it can be enabled by calling omni::structuredlog::IStructuredLogFromILog::enableLogging() or setting /structuredLog/enableLogConsumer to true with ISettings.

Public Functions

inline void enableLogging() noexcept

Enable the structured log logger.

Remark

Enabling this will result in all Carbonite logging (e.g. CARB_LOG_*) and all Omniverse logging (e.g. OMNI_LOG_*) going to the structured log log file. This may be useful if you want the logs to be consumed by some sort of log reader program. These log events will be sent to the default structured log system’s log file if there is one; they will otherwise go to a log file named “omni.structuredlog.logging-{version}”. These log events will not be sent to the collection servers.

inline void disableLogging() noexcept

Disables the structured log logger.

Remark

After this is called, log messages will no longer be sent as structured log events to the structured log system’s log file.

inline omni::structuredlog::EventId getLoggingEventId() noexcept

Get the omni::structuredlog::EventId of the logging schema.

Remark

This is only needed if you need to query properties of the logging schema, such as the log file name.

Note

The logging schema will still be valid when logging is disabled.

Return values

omni::structuredlog::EventId – of the logging schema.

inline void *cast(omni::core::TypeId id) noexcept

Returns a pointer to the interface defined by the given type id if this object implements the type id’s interface.

Objects can support multiple interfaces, even interfaces that are in different inheritance chains.

The returned object will have omni::core::IObject::acquire() called on it before it is returned, meaning it is up to the caller to call omni::core::IObject::release() on the returned pointer.

The returned pointer can be safely reinterpret_cast<> to the type id’s C++ class. For example, “omni.windowing.IWindow” can be cast to omni::windowing::IWindow.

Do not directly use this method, rather use a wrapper function like omni::core::cast() or omni::core::ObjectPtr::as().

Thread Safety

This method is thread safe.

inline void acquire() noexcept

Increments the object’s reference count.

Objects may have multiple reference counts (e.g. one per interface implemented). As such, it is important that you call omni::core::IObject::release() on the same pointer from which you called omni::core::IObject::acquire().

Do not directly use this method, rather use omni::core::ObjectPtr, which will manage calling omni::core::IObject::acquire() and omni::core::IObject::release() for you.

Thread Safety

This method is thread safe.

inline void release() noexcept

Decrements the objects reference count.

Most implementations will destroy the object if the reference count reaches 0 (though this is not a requirement).

Objects may have multiple reference counts (e.g. one per interface implemented). As such, it is important that you call omni::core::IObject::release() on the same pointer from which you called omni::core::IObject::acquire().

Do not directly use this method, rather use omni::core::ObjectPtr, which will manage calling omni::core::IObject::acquire() and omni::core::IObject::release() for you.

Thread Safety

This method is thread safe.

Protected Functions

virtual void enableLogging_abi() noexcept = 0

Enable the structured log logger.

Remark

Enabling this will result in all Carbonite logging (e.g. CARB_LOG_*) and all Omniverse logging (e.g. OMNI_LOG_*) going to the structured log log file. This may be useful if you want the logs to be consumed by some sort of log reader program. These log events will be sent to the default structured log system’s log file if there is one; they will otherwise go to a log file named “omni.structuredlog.logging-{version}”. These log events will not be sent to the collection servers.

virtual void disableLogging_abi() noexcept = 0

Disables the structured log logger.

Remark

After this is called, log messages will no longer be sent as structured log events to the structured log system’s log file.

virtual EventId getLoggingEventId_abi() noexcept = 0

Get the omni::structuredlog::EventId of the logging schema.

Remark

This is only needed if you need to query properties of the logging schema, such as the log file name.

Note

The logging schema will still be valid when logging is disabled.

Return values

omni::structuredlog::EventId – of the logging schema.

virtual void *cast_abi(TypeId id) noexcept = 0

Returns a pointer to the interface defined by the given type id if this object implements the type id’s interface.

Objects can support multiple interfaces, even interfaces that are in different inheritance chains.

The returned object will have omni::core::IObject::acquire() called on it before it is returned, meaning it is up to the caller to call omni::core::IObject::release() on the returned pointer.

The returned pointer can be safely reinterpret_cast<> to the type id’s C++ class. For example, “omni.windowing.IWindow” can be cast to omni::windowing::IWindow.

Do not directly use this method, rather use a wrapper function like omni::core::cast() or omni::core::ObjectPtr::as().

Thread Safety

This method is thread safe.

virtual void acquire_abi() noexcept = 0

Increments the object’s reference count.

Objects may have multiple reference counts (e.g. one per interface implemented). As such, it is important that you call omni::core::IObject::release() on the same pointer from which you called omni::core::IObject::acquire().

Do not directly use this method, rather use omni::core::ObjectPtr, which will manage calling omni::core::IObject::acquire() and omni::core::IObject::release() for you.

Thread Safety

This method is thread safe.

virtual void release_abi() noexcept = 0

Decrements the objects reference count.

Most implementations will destroy the object if the reference count reaches 0 (though this is not a requirement).

Objects may have multiple reference counts (e.g. one per interface implemented). As such, it is important that you call omni::core::IObject::release() on the same pointer from which you called omni::core::IObject::acquire().

Do not directly use this method, rather use omni::core::ObjectPtr, which will manage calling omni::core::IObject::acquire() and omni::core::IObject::release() for you.

Thread Safety

This method is thread safe.