Interface IScopeFormater
IScopeFormater defines the formatter interface. Every scope has start and end, can contain nested scope and lines between start an end. In addition to it, every scope can log the time of execution. Formatter interfaces describes the contract for developing customize formatter.
Namespace: DevInstance.LogScope
Assembly: DevInstance.LogScope.dll
Syntax
public interface IScopeFormater
Methods
| Improve this Doc View SourceFormatLine(String, String)
Returns formated message
Declaration
string FormatLine(string scopeName, string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | scopeName | scope name |
System.String | message | message |
Returns
Type | Description |
---|---|
System.String |
FormatNestedScopes(String, String)
Constructs full scope name, a combination parent and child scope
Declaration
string FormatNestedScopes(string scopeName, string childScope)
Parameters
Type | Name | Description |
---|---|---|
System.String | scopeName | parent scope name |
System.String | childScope | child scope name |
Returns
Type | Description |
---|---|
System.String | return full name. Example: 'parent:child' |
ScopeEnd(DateTime, String, TimeSpan)
Called when scope ends
Declaration
string ScopeEnd(DateTime endTime, string scopeName, TimeSpan execTime)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | endTime | time of the scope's end |
System.String | scopeName | scope name |
System.TimeSpan | execTime | total time between start and end |
Returns
Type | Description |
---|---|
System.String |
ScopeStart(DateTime, String)
Called when scope starts
Declaration
string ScopeStart(DateTime timeStart, string scopeName)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | timeStart | time of the scope's creation |
System.String | scopeName | scope name |
Returns
Type | Description |
---|---|
System.String | formated string |