IStructuredLogSettings
- class omni.structuredlog.IStructuredLogSettings
Bases:
_IStructuredLogSettings
Structured log settings interface. This allows a host app to modify some behavior of the structured log system for the process or to retrieve information about the current settings. These settings control features such as the event queue size, log rotation, event ID generation, the output log path, and the user ID. Most of the default settings should be sufficient for most apps with the exception of the user ID. For host apps that use at least one non-anonymized schema the only settings that must be set is the user ID.
This interface object can be acquired either by requesting it from the type factory or by casting an IStructuredLog object to this type.
Methods
__init__
(*args, **kwargs)Overloaded function.
Checks app settings to see if any schemas or events should be disabled or enabled.
get_log_path_for_event
(self, event_id)Retrieves the log path that a given event will be written to.
load_privacy_settings
(self)Attempts to load the privacy settings file.
set_event_id_mode
(self, mode, type)Sets the current event identifier mode and type.
Attributes
event_id_mode
event_id_type
event_queue_size
log_default_name
log_output_path
log_retention_count
log_size_limit
session_id
user_id
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: omni.structuredlog._structuredlog.IStructuredLogSettings, arg0: omni.core._core.IObject) -> None
__init__(self: omni.structuredlog._structuredlog.IStructuredLogSettings) -> None
- enable_schemas_from_settings(self: omni.structuredlog._structuredlog._IStructuredLogSettings) bool
Checks app settings to see if any schemas or events should be disabled or enabled.
- @returns ``true`` if the settings registry was successfully checked for enable or disable
states. Returns ``false`` if the ref carb::settings::ISettings or ref carb::dictionary::IDictionary plugins have not been loaded yet.
- @remarks This checks the settings registry to determine if any schemas or events should
be disabled initially. The keys in the settings registry that will be looked at are under @ref omni::structuredlog::kSchemasStateListSetting, @ref omni::structuredlog::kEventsStateListSetting, @ref omni::structuredlog::kEventsStateArraySetting, and @ref omni::structuredlog::kSchemasStateArraySetting. Each of these parts of the settings registry expects the schema or event name to be specified in a different way. Once the settings have been loaded, they are cached internally and will be used as the initial state of any newly registered schemas or events. Any state changes to events or schemas after these settings are cached can still be done programmatically with @ref omni::structuredlog::IStructuredLog::setEnabled().
- get_log_path_for_event(self: omni.structuredlog._structuredlog._IStructuredLogSettings, event_id: int) str
Retrieves the log path that a given event will be written to.
- @param[in] eventId The ID of the event to retrieve the log path for. This must be the
same ID used when the event was registered. This may also be @ref omni::structuredlog::kDefaultLogPathEvent to retrieve the path for the default log.
- @returns The name and path of the log file that the requested event would go to if it
were emitted with current settings.
- @returns the name and path of the default log file if kDefaultLogPathEvent is used for
for the event ID.
- @returns ``nullptr`` if the given event ID is unknown or kDefaultLogPathEvent was used
and no default log name has been set.
- @thread_safety This call itself is thread safe. However, the returned string is only
valid until either the log path or the default log name changes. It is the caller’s responsibility to ensure the returned string is used safely.
- load_privacy_settings(self: omni.structuredlog._structuredlog._IStructuredLogSettings) bool
Attempts to load the privacy settings file.
@returns ``true`` if the privacy settings file was successfully loaded.
- @returns ``false`` if the privacy settings file could not be loaded. This failure may be
caused by the file being missing, failing to open the file due to permissions, failing to allocate memory to read in the file, the file not being formatted correctly as a TOML file, or failing to merge the new values into the settings registry.
- @remarks This will attempt to load the privacy settings file for the current user. Regardless
of whether the file is successfully loaded, appropriate defaults will always be set for each of the expected privacy settings (as long as the ISettings interface is available).
- @note This expects that some other system has already found and attempted to load the
plugin that implements the ISettings interface.
- set_event_id_mode(self: omni.structuredlog._structuredlog._IStructuredLogSettings, mode: omni::structuredlog::IdMode, type: omni::structuredlog::IdType) None
Sets the current event identifier mode and type.
- @param[in] mode The new identifier mode to use. This will take effect on the next
event that is sent. The default is IdMode::eFastSequential.
- @param[in] type The new identifier type to use. This will take effect on the next
event that is sent. The default is IdType::eUuid.
@returns No return value.
@thread_safety This call is thread safe.