Energy Core Library
Energy.Core.Bug Class Reference

Bug More...

Classes

class  Class
 
struct  Code
 Bug message code. May be numbered, litereal or both. More...
 
struct  Entry
 Bug message entry. More...
 

Static Public Member Functions

static void SetExceptionMessageAppendNameFormat (string value)
 
static string ExceptionMessage (Exception exception, bool trace)
 Return exception message More...
 
static string ExceptionMessage (Exception exception)
 Return exception message More...
 
static string GetExceptionMessage (Exception exception, bool trace)
 Return exception message More...
 
static string GetExceptionMessage (Exception exception, bool trace, string name)
 
static string GetExceptionMessage (Exception exception, bool trace, bool includeClassName)
 
static string ThreadIdHex (System.Threading.Thread thread)
 Get thread id as hex string. More...
 
static string ThreadIdHex ()
 Get current thread id as hex string. More...
 
static string CallingMethod (int stack)
 Return calling method name More...
 
static string CallingMethod ()
 Return calling method name More...
 
static string FormatDebugOutput (string message)
 
static void Catch (Exception exception)
 Handle exception More...
 
static void Write (string message)
 Write debug message More...
 
static void Write (Code code, string message)
 Write debug message with numeric code which may be suppressed or limited. More...
 
static void Write (Code code, Energy.Base.Anonymous.String action)
 Write debug message with numeric code which may be suppressed or limited. Provide a function that returns message and will be invoked only if not suppressed. More...
 
static void Write (Exception exception)
 Write debug message from an exception More...
 
static void Write (Code code, Exception exception)
 Write debug message from an exception with numeric code which may be suppressed or limited. More...
 
static void WriteFormat (string format, params object[] args)
 Write debug message More...
 
static void WriteFormat (IFormatProvider provider, string format, params object[] args)
 Write debug message More...
 
static Energy.Base.Trap Trap (double timeLimit, Energy.Base.Anonymous.Function< TimeSpan > action)
 Create time trap for execution. While disposed, it will invoke optional action. More...
 
static Energy.Base.Trap Trap (double timeLimit, Energy.Base.Anonymous.Function action)
 Create time trap for execution. While disposed, it will invoke optional action. More...
 
static void Suppress (Code code)
 Suppress message identified by code. More...
 
static void Suppress (Code code, bool suppress)
 Suppress message identified by code. Optionaly "unsuppress" by calling with suppress:false parameter. More...
 
static bool IsSuppressed (Code code)
 

Static Public Attributes

static Energy.Base.Switch ExceptionTrace
 Exception trace switch More...
 
static Energy.Base.Switch DebugOutputTime
 Use time when writing to System.Diagnostics.Debug More...
 
static Energy.Base.Switch DebugOutputCode
 Prefix with code number when writing to System.Diagnostics.Debug More...
 

Properties

static Energy.Core.Log.Logger Logger [set]
 Log More...
 
static Entry Last [get, set]
 Last entry More...
 

Detailed Description

Member Function Documentation

◆ CallingMethod() [1/2]

static string Energy.Core.Bug.CallingMethod ( int  stack)
static

Return calling method name

Parameters
stackint
Returns
string

◆ CallingMethod() [2/2]

static string Energy.Core.Bug.CallingMethod ( )
static

Return calling method name

Returns
string

◆ Catch()

static void Energy.Core.Bug.Catch ( Exception  exception)
static

Handle exception

Parameters
exception

◆ ExceptionMessage() [1/2]

static string Energy.Core.Bug.ExceptionMessage ( Exception  exception,
bool  trace 
)
static

Return exception message

Parameters
exceptionException object
traceInclude stack trace
Returns
string

◆ ExceptionMessage() [2/2]

static string Energy.Core.Bug.ExceptionMessage ( Exception  exception)
static

Return exception message

Parameters
exceptionException object
Returns
string

◆ FormatDebugOutput()

static string Energy.Core.Bug.FormatDebugOutput ( string  message)
static

◆ GetExceptionMessage() [1/3]

static string Energy.Core.Bug.GetExceptionMessage ( Exception  exception,
bool  trace 
)
static

Return exception message

Parameters
exceptionException object
traceInclude stack trace
Returns
string

◆ GetExceptionMessage() [2/3]

static string Energy.Core.Bug.GetExceptionMessage ( Exception  exception,
bool  trace,
string  name 
)
static

◆ GetExceptionMessage() [3/3]

static string Energy.Core.Bug.GetExceptionMessage ( Exception  exception,
bool  trace,
bool  includeClassName 
)
static

◆ IsSuppressed()

static bool Energy.Core.Bug.IsSuppressed ( Code  code)
static

◆ SetExceptionMessageAppendNameFormat()

static void Energy.Core.Bug.SetExceptionMessageAppendNameFormat ( string  value)
static

◆ Suppress() [1/2]

static void Energy.Core.Bug.Suppress ( Code  code)
static

Suppress message identified by code.

Parameters
code

◆ Suppress() [2/2]

static void Energy.Core.Bug.Suppress ( Code  code,
bool  suppress 
)
static

Suppress message identified by code. Optionaly "unsuppress" by calling with suppress:false parameter.

Parameters
code
suppress

◆ ThreadIdHex() [1/2]

static string Energy.Core.Bug.ThreadIdHex ( System.Threading.Thread  thread)
static

Get thread id as hex string.

Parameters
thread
Returns

◆ ThreadIdHex() [2/2]

static string Energy.Core.Bug.ThreadIdHex ( )
static

Get current thread id as hex string.

Returns

◆ Trap() [1/2]

static Energy.Base.Trap Energy.Core.Bug.Trap ( double  timeLimit,
Energy.Base.Anonymous.Function< TimeSpan >  action 
)
static

Create time trap for execution. While disposed, it will invoke optional action.

Parameters
timeLimitTime limit in seconds. When finished in shorter time, action will not be executed.
actionAction when time exceeds limit
Returns

◆ Trap() [2/2]

static Energy.Base.Trap Energy.Core.Bug.Trap ( double  timeLimit,
Energy.Base.Anonymous.Function  action 
)
static

Create time trap for execution. While disposed, it will invoke optional action.

Parameters
timeLimitTime limit in seconds. When finished in shorter time, action will not be executed.
actionAction when time exceeds limit
Returns

◆ Write() [1/5]

static void Energy.Core.Bug.Write ( string  message)
static

Write debug message

Parameters
message

◆ Write() [2/5]

static void Energy.Core.Bug.Write ( Code  code,
string  message 
)
static

Write debug message with numeric code which may be suppressed or limited.

Parameters
code
message

◆ Write() [3/5]

static void Energy.Core.Bug.Write ( Code  code,
Energy.Base.Anonymous.String  action 
)
static

Write debug message with numeric code which may be suppressed or limited. Provide a function that returns message and will be invoked only if not suppressed.

Parameters
code
action

◆ Write() [4/5]

static void Energy.Core.Bug.Write ( Exception  exception)
static

Write debug message from an exception

Parameters
exception

◆ Write() [5/5]

static void Energy.Core.Bug.Write ( Code  code,
Exception  exception 
)
static

Write debug message from an exception with numeric code which may be suppressed or limited.

Parameters
code
exception

◆ WriteFormat() [1/2]

static void Energy.Core.Bug.WriteFormat ( string  format,
params object []  args 
)
static

Write debug message

Parameters
format
args

◆ WriteFormat() [2/2]

static void Energy.Core.Bug.WriteFormat ( IFormatProvider  provider,
string  format,
params object []  args 
)
static

Write debug message

Parameters
provider
format
args

Member Data Documentation

◆ DebugOutputCode

Energy.Base.Switch Energy.Core.Bug.DebugOutputCode
static

Prefix with code number when writing to System.Diagnostics.Debug

◆ DebugOutputTime

Energy.Base.Switch Energy.Core.Bug.DebugOutputTime
static

Use time when writing to System.Diagnostics.Debug

◆ ExceptionTrace

Energy.Base.Switch Energy.Core.Bug.ExceptionTrace
static

Exception trace switch

Property Documentation

◆ Last

Entry Energy.Core.Bug.Last
staticgetset

Last entry

◆ Logger

Energy.Core.Log.Logger Energy.Core.Bug.Logger
staticset

Log


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