Show / Hide Table of Contents

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 Source

FormatLine(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
| Improve this Doc View Source

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'

| Improve this Doc View Source

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
| Improve this Doc View Source

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

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX