Class Logger
Inherited Members
Namespace: PKWARE.Smartcrypt.MetaClient.Logging
Assembly: MetaClient.dll
Syntax
public abstract class Logger
Fields
Level
Declaration
public Level Level
Field Value
Type | Description |
---|---|
Level |
Methods
Debug(String, Exception, Int32, String, String)
Log a debug message. If both message
and exception
are null
, this call is a no-op.
Declaration
public void Debug([CanBeNull] string message, [CanBeNull] Exception exception = null, int lineNumber = 0, string methodName = "", string filePath = "")
Parameters
Type | Name | Description |
---|---|---|
String | message | |
Exception | exception | |
Int32 | lineNumber | Do not supply a value for this. This will be supplied by the compiler. |
String | methodName | Do not supply a value for this. This will be supplied by the compiler. |
String | filePath | Do not supply a value for this. This will be supplied by the compiler. |
Error(String, Exception, Int32, String, String)
Log an error message. If both message
and exception
are null
, this call is a no-op.
Declaration
public void Error([CanBeNull] string message, [CanBeNull] Exception exception = null, int lineNumber = 0, string methodName = "", string filePath = "")
Parameters
Type | Name | Description |
---|---|---|
String | message | |
Exception | exception | |
Int32 | lineNumber | Do not supply a value for this. This will be supplied by the compiler. |
String | methodName | Do not supply a value for this. This will be supplied by the compiler. |
String | filePath | Do not supply a value for this. This will be supplied by the compiler. |
FormatTag(Int32, String, String)
Combines various data to form a single string which represents the statement's tag.
Declaration
protected virtual string FormatTag(int lineNumber, string methodName, string fileName)
Parameters
Type | Name | Description |
---|---|---|
Int32 | lineNumber | |
String | methodName | |
String | fileName | The file name without the extension. |
Returns
Type | Description |
---|---|
String |
Remarks
A sane default is provided. If you have multiple log streams going into a single output channel, you may want to add additional identifier information to the tag.
Info(String, Exception, Int32, String, String)
Log an info message. If both message
and exception
are null
, this call is a no-op.
Declaration
public void Info([CanBeNull] string message, [CanBeNull] Exception exception = null, int lineNumber = 0, string methodName = "", string filePath = "")
Parameters
Type | Name | Description |
---|---|---|
String | message | |
Exception | exception | |
Int32 | lineNumber | Do not supply a value for this. This will be supplied by the compiler. |
String | methodName | Do not supply a value for this. This will be supplied by the compiler. |
String | filePath | Do not supply a value for this. This will be supplied by the compiler. |
Log(Level, String, String, Exception)
Write a log message to its destination. Called for all level-specific methods by default.
Declaration
protected abstract void Log(Level level, string tag, string message, [CanBeNull] Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Level | level | The logging level at which the message was reported. |
String | tag | Used to identify the source of the message. FormatTag(Int32, String, String). |
String | message | That was logged. If an exception was logged, the message will already contain the exception's information. |
Exception | exception |
|
Trace(String, Exception, Int32, String, String)
Log a trace message. If both message
and exception
are null
, this call is a no-op.
Declaration
public void Trace([CanBeNull] string message, [CanBeNull] Exception exception = null, int lineNumber = 0, string methodName = "", string filePath = "")
Parameters
Type | Name | Description |
---|---|---|
String | message | |
Exception | exception | |
Int32 | lineNumber | Do not supply a value for this. This will be supplied by the compiler. |
String | methodName | Do not supply a value for this. This will be supplied by the compiler. |
String | filePath | Do not supply a value for this. This will be supplied by the compiler. |
Warn(String, Exception, Int32, String, String)
Log a warning message. If both message
and exception
are null
, this call is a no-op.
Declaration
public void Warn([CanBeNull] string message, [CanBeNull] Exception exception = null, int lineNumber = 0, string methodName = "", string filePath = "")
Parameters
Type | Name | Description |
---|---|---|
String | message | |
Exception | exception | |
Int32 | lineNumber | Do not supply a value for this. This will be supplied by the compiler. |
String | methodName | Do not supply a value for this. This will be supplied by the compiler. |
String | filePath | Do not supply a value for this. This will be supplied by the compiler. |