Class Log
The logging class for World Modeler.
Inherited Members
Namespace: Quantellia.WMServer.Logger
Assembly: WMServer.dll
Syntax
public class Log
Remarks
Log instances are static and stored in the private
Properties
Level
The level at which log messages will be written out for this Log instance.
Declaration
public int Level { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
MessageBuffer
provides a buffer for messages to prevent messages from being missed
Declaration
public List<string> MessageBuffer { get; }
Property Value
| Type | Description |
|---|---|
| List<string> |
ShowSourceRef
Show the source file and line number from which the log entyry is being called.
Declaration
public bool ShowSourceRef { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
ShowTime
Show the time of each log entry.
Declaration
public bool ShowTime { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
Init(ConfigurationManager)
Initialize the logger.
Declaration
public static void Init(ConfigurationManager configMgr)
Parameters
| Type | Name | Description |
|---|---|---|
| ConfigurationManager | configMgr |
Remarks
The logging configuration is read from the application's ConfigurationManager.
Throw(string, int, Exception?)
Declaration
[Obsolete("This method is effectively a pipe to report errors to the API user, but doesn't support any kind of standardization. Developers should use Quantellia.REST.RestError instead. \n I.e. instead of Log.Throw(\"Your license has expired as of 10/25/2025.\",403), developers should use throw RestError.LicenseExpired(\"10/25/2025\")")]
public static void Throw(string message, int status = -1, Exception? innerException = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | message | |
| int | status | |
| Exception | innerException |
Write(string, LogLevel, int, bool)
Declaration
public static void Write(string message, LogLevel level = LogLevel.Debug, int additionalStackLevels = 0, bool writeHeader = true)
Parameters
| Type | Name | Description |
|---|---|---|
| string | message | The message |
| LogLevel | level | The loglevel for this message. Debug by default. |
| int | additionalStackLevels | Adds the specified previous frames to the message. By default zero. |
| bool | writeHeader | Writes the message header if true. |