EGDL2 2.1
Loading...
Searching...
No Matches
WebSocketSharp.Logger Class Reference

Provides a set of methods and properties for logging. More...

Public Member Functions

 Logger ()
 Initializes a new instance of the Logger class.
 
 Logger (LogLevel level)
 Initializes a new instance of the Logger class with the specified logging level .
 
 Logger (LogLevel level, string file, Action< LogData, string > output)
 Initializes a new instance of the Logger class with the specified logging level , path to the log file , and output action.
 
void Debug (string message)
 Outputs message as a log with LogLevel.Debug.
 
void Error (string message)
 Outputs message as a log with LogLevel.Error.
 
void Fatal (string message)
 Outputs message as a log with LogLevel.Fatal.
 
void Info (string message)
 Outputs message as a log with LogLevel.Info.
 
void Trace (string message)
 Outputs message as a log with LogLevel.Trace.
 
void Warn (string message)
 Outputs message as a log with LogLevel.Warn.
 

Properties

string File [get, set]
 Gets or sets the path to the log file.
 
LogLevel Level [get, set]
 Gets or sets the current logging level.
 
Action< LogData, string > Output [get, set]
 Gets or sets the current output action used to output a log.
 

Detailed Description

Provides a set of methods and properties for logging.

If you output a log with lower than the Logger.Level, it cannot be outputted.

The default output action writes a log to the standard output stream and the Logger.File if it has a valid path.

If you would like to use the custom output action, you should set the Logger.Output to any Action<LogData, string>.

Constructor & Destructor Documentation

◆ Logger() [1/3]

WebSocketSharp.Logger.Logger ( )
inline

Initializes a new instance of the Logger class.

This constructor initializes the current logging level with LogLevel.Error.

◆ Logger() [2/3]

WebSocketSharp.Logger.Logger ( LogLevel level)
inline

Initializes a new instance of the Logger class with the specified logging level .

Parameters
levelOne of the LogLevel enum values.

◆ Logger() [3/3]

WebSocketSharp.Logger.Logger ( LogLevel level,
string file,
Action< LogData, string > output )
inline

Initializes a new instance of the Logger class with the specified logging level , path to the log file , and output action.

Parameters
levelOne of the LogLevel enum values.
fileA string that represents the path to the log file.
outputAn Action<LogData, string> delegate that references the method(s) used to output a log. A string parameter passed to this delegate is file .

Member Function Documentation

◆ Debug()

void WebSocketSharp.Logger.Debug ( string message)
inline

Outputs message as a log with LogLevel.Debug.

If the current logging level is higher than LogLevel.Debug, this method doesn't output message as a log.

Parameters
messageA string that represents the message to output as a log.

◆ Error()

void WebSocketSharp.Logger.Error ( string message)
inline

Outputs message as a log with LogLevel.Error.

If the current logging level is higher than LogLevel.Error, this method doesn't output message as a log.

Parameters
messageA string that represents the message to output as a log.

◆ Fatal()

void WebSocketSharp.Logger.Fatal ( string message)
inline

Outputs message as a log with LogLevel.Fatal.

Parameters
messageA string that represents the message to output as a log.

◆ Info()

void WebSocketSharp.Logger.Info ( string message)
inline

Outputs message as a log with LogLevel.Info.

If the current logging level is higher than LogLevel.Info, this method doesn't output message as a log.

Parameters
messageA string that represents the message to output as a log.

◆ Trace()

void WebSocketSharp.Logger.Trace ( string message)
inline

Outputs message as a log with LogLevel.Trace.

If the current logging level is higher than LogLevel.Trace, this method doesn't output message as a log.

Parameters
messageA string that represents the message to output as a log.

◆ Warn()

void WebSocketSharp.Logger.Warn ( string message)
inline

Outputs message as a log with LogLevel.Warn.

If the current logging level is higher than LogLevel.Warn, this method doesn't output message as a log.

Parameters
messageA string that represents the message to output as a log.

Property Documentation

◆ File

string WebSocketSharp.Logger.File
getset

Gets or sets the path to the log file.

A string that represents the path to the log file if any.

◆ Level

LogLevel WebSocketSharp.Logger.Level
getset

Gets or sets the current logging level.

A log with lower than the value of this property cannot be outputted.

One of the LogLevel enum values, indicates the current logging level.

◆ Output

Action<LogData, string> WebSocketSharp.Logger.Output
getset

Gets or sets the current output action used to output a log.

An Action<LogData, string> delegate that references the method(s) used to output a log. A string parameter passed to this delegate is the value of the Logger.File.

If the value to set is null, the current output action is changed to the default output action.


The documentation for this class was generated from the following file: