C# Class CK.Core.LogFilter

ファイルを表示 Open project: Invenietis/ck-core Class Usage Examples

Public Properties

Property Type Description
Debug LogFilter
Group LogLevelFilter
Invalid LogFilter
Line LogLevelFilter
Monitor LogFilter
Off LogFilter
Release LogFilter
Terse LogFilter
Undefined LogFilter
Verbose LogFilter

Public Methods

Method Description
Combine ( LogFilter other ) : LogFilter

Combines this filter with another one. Line and Group level filters are combined with Combine(LogLevelFilter,LogLevelFilter).

Combine ( LogLevelFilter x, LogLevelFilter y ) : LogLevelFilter

Combines two enums LogLevelFilter into one. The resulting filter is the more verbose one (the smallest level). LogLevelFilter.Invalid is considered as LogLevelFilter.None (it has no impact). This operation is commutative and associative: different order of combination always give the same result.

CombineNoneOnly ( LogFilter other ) : LogFilter

Combines this filter with another one only if Line or Group is LogLevelFilter.None.

Equals ( object obj ) : bool

Overridden to compare Line and Group.

GetHashCode ( ) : int

Overridden to compute hash based on Line and Group values.

HasImpactOn ( LogFilter x ) : bool

Tests if Combine(LogFilter)">combining this and

LogFilter ( LogLevelFilter group, LogLevelFilter line ) : CK.Text

Initializes a new LogFilter with a level for Groups and Line logs.

Parse ( string filter ) : LogFilter

Parses the filter: it can be a predefined filter as ("Undefined", "Debug", "Verbose", etc.) or as {GroupLogLevelFilter,LineLogLevelFilter} pairs like "{None,None}", "{Error,Trace}".

SetGroup ( LogLevelFilter group ) : LogFilter

Returns a LogFilter with a given LogLevelFilter for the Group.

SetLine ( LogLevelFilter line ) : LogFilter

Returns a LogFilter with a given LogLevelFilter for the Line.

ToString ( ) : string

Overridden to show the group and the line level.

TryParse ( string s, LogFilter &f ) : bool

Tries to parse a LogFilter: it can be a predefined filter as ("Undefined", "Debug", "Verbose", etc.) or as {GroupLogLevelFilter,LineLogLevelFilter} pairs like "{None,None}", "{Error,Trace}".

operator ( ) : bool

Equality operator.

Method Details

Combine() public method

Combines this filter with another one. Line and Group level filters are combined with Combine(LogLevelFilter,LogLevelFilter).
public Combine ( LogFilter other ) : LogFilter
other LogFilter The other filter to combine with this one.
return LogFilter

Combine() static public method

Combines two enums LogLevelFilter into one. The resulting filter is the more verbose one (the smallest level). LogLevelFilter.Invalid is considered as LogLevelFilter.None (it has no impact). This operation is commutative and associative: different order of combination always give the same result.
static public Combine ( LogLevelFilter x, LogLevelFilter y ) : LogLevelFilter
x LogLevelFilter First filter level.
y LogLevelFilter Second filter level.
return LogLevelFilter

CombineNoneOnly() public method

Combines this filter with another one only if Line or Group is LogLevelFilter.None.
public CombineNoneOnly ( LogFilter other ) : LogFilter
other LogFilter The other filter to combine with this one.
return LogFilter

Equals() public method

Overridden to compare Line and Group.
public Equals ( object obj ) : bool
obj object Other object.
return bool

GetHashCode() public method

Overridden to compute hash based on Line and Group values.
public GetHashCode ( ) : int
return int

HasImpactOn() public method

Tests if Combine(LogFilter)">combining this and
public HasImpactOn ( LogFilter x ) : bool
x LogFilter The other filter.
return bool

LogFilter() public method

Initializes a new LogFilter with a level for Groups and Line logs.
public LogFilter ( LogLevelFilter group, LogLevelFilter line ) : CK.Text
group LogLevelFilter Filter for groups.
line LogLevelFilter Filter for lines.
return CK.Text

Parse() public static method

Parses the filter: it can be a predefined filter as ("Undefined", "Debug", "Verbose", etc.) or as {GroupLogLevelFilter,LineLogLevelFilter} pairs like "{None,None}", "{Error,Trace}".
public static Parse ( string filter ) : LogFilter
filter string Predefined filter as (Undefined, Debug, Verbose, etc.) or as {LineLogLevelFilter,GroupLogLevelFilter} like {None,None}, {Error,Trace}.
return LogFilter

SetGroup() public method

Returns a LogFilter with a given LogLevelFilter for the Group.
public SetGroup ( LogLevelFilter group ) : LogFilter
group LogLevelFilter Filter for the group.
return LogFilter

SetLine() public method

Returns a LogFilter with a given LogLevelFilter for the Line.
public SetLine ( LogLevelFilter line ) : LogFilter
line LogLevelFilter Filter for the line.
return LogFilter

ToString() public method

Overridden to show the group and the line level.
public ToString ( ) : string
return string

TryParse() public static method

Tries to parse a LogFilter: it can be a predefined filter as ("Undefined", "Debug", "Verbose", etc.) or as {GroupLogLevelFilter,LineLogLevelFilter} pairs like "{None,None}", "{Error,Trace}".
public static TryParse ( string s, LogFilter &f ) : bool
s string Filter to parse.
f LogFilter Resulting filter.
return bool

operator() public static method

Equality operator.
public static operator ( ) : bool
return bool

Property Details

Debug static_oe public_oe property

Debug filter enables full LogLevelFilter.Trace for both Line and Group.
static public LogFilter,CK.Core Debug
return LogFilter

Group public_oe property

The filter that applies to groups.
public LogLevelFilter Group
return LogLevelFilter

Invalid static_oe public_oe property

Invalid must be used as a special value. It is LogLevelFilter.Invalid for both Line and Group.
static public LogFilter,CK.Core Invalid
return LogFilter

Line public_oe property

The filter that applies to log lines (Trace, Info, Warn, Error and Fatal).
public LogLevelFilter Line
return LogLevelFilter

Monitor static_oe public_oe property

While monitoring, only errors and warnings are captured, whereas all Groups appear to get the detailed structure of the activity.
static public LogFilter,CK.Core Monitor
return LogFilter

Off static_oe public_oe property

Off filter does not capture anything.
static public LogFilter,CK.Core Off
return LogFilter

Release static_oe public_oe property

Release filter captures only LogLevelFilter.Errors for both Line and Group.
static public LogFilter,CK.Core Release
return LogFilter

Terse static_oe public_oe property

Terse filter captures only errors for Line and limits Groups to LogLevelFilter.Info level.
static public LogFilter,CK.Core Terse
return LogFilter

Undefined static_oe public_oe property

Undefined filter is LogLevelFilter.None for both Line and Group. This is the same as using the default constructor for this structure (it is exposed here for clarity).
static public LogFilter,CK.Core Undefined
return LogFilter

Verbose static_oe public_oe property

Verbose LogLevelFilter.Trace all Groups but limits Line to LogLevelFilter.Info level.
static public LogFilter,CK.Core Verbose
return LogFilter