My Project
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Pages
Public Member Functions | Properties | List of all members
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 delegate used to output a log.
 
void Debug (string message)
 Outputs the specified message as a log with the Debug level.
 
void Error (string message)
 Outputs the specified message as a log with the Error level.
 
void Fatal (string message)
 Outputs the specified message as a log with the Fatal level.
 
void Info (string message)
 Outputs the specified message as a log with the Info level.
 
void Trace (string message)
 Outputs the specified message as a log with the Trace level.
 
void Warn (string message)
 Outputs the specified message as a log with the Warn level.
 

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 delegate 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 current logging level, it cannot be outputted.

The default output method writes a log to the standard output stream and the text file if it has a valid path.

If you would like to use the custom output method, you should specify it with the constructor or the Logger.Output property.

Constructor & Destructor Documentation

◆ Logger() [1/3]

WebSocketSharp.Logger.Logger ( )
inline

Initializes a new instance of the Logger class.

This constructor initializes the logging level with the Error level.

◆ 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 that specifies the logging level.

◆ 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 delegate used to output a log.

Parameters
levelOne of the LogLevel enum values that specifies the logging level.
fileA string that specifies the path to the log file.
outputAn T:System.Action<LogData, string> that specifies the delegate used to output a log.

Member Function Documentation

◆ Debug()

void WebSocketSharp.Logger.Debug ( string  message)
inline

Outputs the specified message as a log with the Debug level.

If the current logging level is higher than the Debug level, this method does not output the message as a log.

Parameters
messageA string that specifies the message to output.

◆ Error()

void WebSocketSharp.Logger.Error ( string  message)
inline

Outputs the specified message as a log with the Error level.

If the current logging level is higher than the Error level, this method does not output the message as a log.

Parameters
messageA string that specifies the message to output.

◆ Fatal()

void WebSocketSharp.Logger.Fatal ( string  message)
inline

Outputs the specified message as a log with the Fatal level.

Parameters
messageA string that specifies the message to output.

◆ Info()

void WebSocketSharp.Logger.Info ( string  message)
inline

Outputs the specified message as a log with the Info level.

If the current logging level is higher than the Info level, this method does not output the message as a log.

Parameters
messageA string that specifies the message to output.

◆ Trace()

void WebSocketSharp.Logger.Trace ( string  message)
inline

Outputs the specified message as a log with the Trace level.

If the current logging level is higher than the Trace level, this method does not output the message as a log.

Parameters
messageA string that specifies the message to output.

◆ Warn()

void WebSocketSharp.Logger.Warn ( string  message)
inline

Outputs the specified message as a log with the Warn level.

If the current logging level is higher than the Warn level, this method does not output the message as a log.

Parameters
messageA string that specifies the message to output.

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.

It represents the current logging level.

◆ Output

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

Gets or sets the delegate used to output a log.

An T:System.Action<LogData, string> delegate.

It references the method used to output a log.

The string parameter passed to the delegate is the value of the Logger.File property.

If the value to set is null, the default output method is set.


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