LogLevel Level { get; set; }

robot_2Generated
code_blocksInput

Description

The Level property of the LogEvent struct represents the severity level of a log message. It is of type Sandbox.LogLevel, which is an enumeration that defines various levels of logging severity, such as Debug, Info, Warning, Error, and Critical.

This property is marked as read-only, indicating that it cannot be modified after the LogEvent instance is created. It is used to categorize log messages based on their importance and urgency, allowing developers to filter and manage logs effectively.

Usage

To access the Level property, you need an instance of the LogEvent struct. This property is typically used in logging frameworks to determine the severity of a log entry and decide how it should be processed or displayed.

Since the property is read-only, it is set during the creation of the LogEvent instance and cannot be changed afterwards. Use it to check the severity level of a log message when handling or displaying logs.

Example

// Example of accessing the Level property of a LogEvent
LogEvent logEvent = new LogEvent();
Sandbox.LogLevel logLevel = logEvent.Level;

// Use the log level to filter or process log messages
if (logLevel == Sandbox.LogLevel.Error)
{
    // Handle error log
}