Provides high level functionality for logging things like Exceptions, objects and XML documents.
Public Static Fields | |
static String | FmtExcNull ="<No exception given>" |
The String to log out if the exception parameter equals null. | |
static String | FmtInstArrayPrefix ="array[" |
Prefix before logging size of an IEnumberable. | |
static String | FmtInstArraySuffix ="]" |
Suffix after logging IEnumberable. | |
static String | FmtInstCycRefPrefix ="(Cyclic ref., see line <" |
Prefix before logging out a cyclic reference line number. | |
static String | FmtInstCycRefSuffix =">)" |
Suffix after logging out a cyclic reference line number. | |
static String | FmtInstIEnumerablePrefix ="IEnumerable, size= " |
Prefix before logging size of an IEnumberable. | |
static String | FmtInstIEnumerableSuffix ="" |
Suffix after logging IEnumberable. | |
static String | FmtInstIndent =" " |
Indent String for instance lines. | |
static String | FmtInstLineNoPrefix ="<" |
Prefix for instance line numbers. | |
static String | FmtInstLineNoSuffix =">" |
Suffix for instance line numbers. | |
static String | FmtInstNoAccessToValue ="<no access>" |
String for non-accessible members. | |
static String | FmtInstNull ="<null>" |
The String to log out if a given object instance equals null. | |
static String | FmtInstRecursionLimit ="(MAX REC) " |
static String | FmtInstTypePrefix ="{" |
Prefix for type names. | |
static String | FmtInstTypeSuffix ="}" |
Suffix for type names. | |
static int | instTypeTabStop =65 |
Tab stop for types when logging instances. | |
static int | instValueTabStop =35 |
Tab stop for values when logging instances. | |
Public Static Methods | |
static void | Exception (Exception e, String headline=null, Lox lox=null, [CallerLineNumber] int cln=0,[CallerFilePath] String csf="",[CallerMemberName] String cmn="") |
static void | Exception (String domain, Verbosity verbosity, Exception e, String headline=null, Lox lox=null, [CallerLineNumber] int cln=0,[CallerFilePath] String csf="",[CallerMemberName] String cmn="") |
static void | Exception (Verbosity verbosity, Exception e, String headline=null, Lox lox=null, [CallerLineNumber] int cln=0,[CallerFilePath] String csf="",[CallerMemberName] String cmn="") |
static void | Instance (String domain, Verbosity verbosity, Object o, int maxRecursion, String headline=null, Lox lox=null, [CallerLineNumber] int cln=0,[CallerFilePath] String csf="",[CallerMemberName] String cmn="") |
static void | Instance (Verbosity verbosity, Object o, int maxRecursion, String headline=null, Lox lox=null, [CallerLineNumber] int cln=0,[CallerFilePath] String csf="",[CallerMemberName] String cmn="") |
static void | XML (String domain, Verbosity verbosity, XDocument xDocument, String headLine=null, Lox lox=null, [CallerLineNumber] int cln=0,[CallerFilePath] String csf="",[CallerMemberName] String cmn="") |
static void | XML (String domain, Verbosity verbosity, XElement xElement, String headLine=null, Lox lox=null, [CallerLineNumber] int cln=0,[CallerFilePath] String csf="",[CallerMemberName] String cmn="") |
static void | XML (Verbosity verbosity, XDocument xDocument, String headLine, Lox lox=null, [CallerLineNumber] int cln=0,[CallerFilePath] String csf="",[CallerMemberName] String cmn="") |
static void | XML (Verbosity verbosity, XElement xElement, String headLine, Lox lox=null, [CallerLineNumber] int cln=0,[CallerFilePath] String csf="",[CallerMemberName] String cmn="") |
Protected Static Fields | |
static int | instLineBeginIdx |
Instance index of beginning of line in toolBuf. | |
static uint | instLineNumber |
Instance line number counter. | |
static Dictionary< Object, UInt32 > | instObject2LineNumber |
Instance line number dictionary used to refer to already logged sub objects. | |
static ThreadLock | Lock =new ThreadLock() |
static AString | tempBuf |
Temporary helper buffer. | |
static AString | toolBuf |
Buffer to build log messages. | |
Protected Static Methods | |
static void | exception (Exception e, String headline, int indent) |
static void | instBeginLine (int indent) |
static void | instMain (Object o, int maxRecursion, String headLine) |
static void | instNewLine () |
static void | instRecursive (Object inst, int maxRecursion, int indent) |
static void | instTabStop (int tabStop) |
static void | instTabTypeAndNewLine (Type type) |
static bool | isValueType (Object o, Type type) |
static void | xml (XDocument xDocument, String headLine) |
static void | xmlElement (XElement xe, String headLine, int indent) |
|
inlinestaticprotected |
Logs an exception.
e | The exception to log. |
headline | An optional headline string preceding the exception. |
indent | The indentation in the output (recursively increased). If set to -1 the 'headline' is logged. |
|
inlinestatic |
Log an exception including inner exceptions recursively. Scope Domain is used with Verbosity.Error. Note: Calls to this method are automatically removed from release code.
e | The Exception to log. |
headline | (Optional) A headline string to precede the exception with. |
lox | (Optional) The lox to log with. If null, the static member LOX of the static class Log is used. |
cln | (Optional) Caller info, compiler generated. Please omit. |
csf | (Optional) Caller info, compiler generated. Please omit. |
cmn | (Optional) Caller info, compiler generated. Please omit. |
|
inlinestatic |
Log an exception including inner exceptions recursively. Note: Calls to this method are automatically removed from release code.
domain | The Log Domain. |
verbosity | The verbosity. |
e | The Exception to log. |
headline | (Optional) A headline string to precede the exception with. |
lox | (Optional) The lox to log with. If null, the static member LOX of the static class Log is used. |
cln | (Optional) Caller info, compiler generated. Please omit. |
csf | (Optional) Caller info, compiler generated. Please omit. |
cmn | (Optional) Caller info, compiler generated. Please omit. |
|
inlinestatic |
Log an exception including inner exceptions recursively. Scope Domain of file is used with Verbosity.Error. Note: Calls to this method are automatically removed from release code.
verbosity | The verbosity. |
e | The Exception to log. |
headline | (Optional) A headline string to precede the exception with. |
lox | (Optional) The lox to log with. If null, the static member LOX of the static class Log is used. |
cln | (Optional) Caller info, compiler generated. Please omit. |
csf | (Optional) Caller info, compiler generated. Please omit. |
cmn | (Optional) Caller info, compiler generated. Please omit. |
|
inlinestatic |
Uses reflection to log an object.
domain | The Log Domain which is combined with Scope Domains set for the Scope of invocation. |
verbosity | The verbosity. |
o | The object to be logged. |
maxRecursion | The maximum depth of recursion for logging nested object. |
headline | (Optional) A headline string to precede the exception with. |
lox | (Optional) The lox to log with. If null, the static member LOX of the static class Log is used. |
cln | (Optional) Caller info, compiler generated. Please omit. |
csf | (Optional) Caller info, compiler generated. Please omit. |
cmn | (Optional) Caller info, compiler generated. Please omit. |
|
inlinestatic |
Uses reflection to log an object.
verbosity | The verbosity. |
o | The object to be logged. |
maxRecursion | The maximum depth of recursion for logging nested object. |
headline | (Optional) A headline string to precede the exception with. |
lox | (Optional) The lox to log with. If null, the static member LOX of the static class Log is used. |
cln | (Optional) Caller info, compiler generated. Please omit. |
csf | (Optional) Caller info, compiler generated. Please omit. |
cmn | (Optional) Caller info, compiler generated. Please omit. |
|
inlinestaticprotected |
Appends line number (format defined in fields FmtInstLineNoPrefix and FmtInstLineNoSuffix) and then adds indent characters (defined in field FmtInstIndent).
indent | The indentation of the line. |
|
inlinestaticprotected |
Logs the header and invokes instRecursive()
o | The object to be logged. |
maxRecursion | The maximum depth of recursion for logging nested object. |
headLine | The headline to log. |
|
inlinestaticprotected |
Adds a new line to the buffer and increases line number counter.
|
inlinestaticprotected |
Recursively log an instance using reflection.
inst | The element. |
maxRecursion | The maximum depth of recursion for logging nested object. |
indent | The indentation in the output (recursively increased). |
|
inlinestaticprotected |
Appends spaces to move to the given tabStop (but at least one).
tabStop | The tab stop position to go to |
|
inlinestaticprotected |
Appends type information at the end of the line and starts a new line.
type | The type to append in the log |
|
inlinestaticprotected |
Detects if the given object is of value type. Special treatment is given to KeyValuePair<,>. C# treat them as a value type that causes some irritation sometimes.
o | The object to be tested. |
type | The type of the object (needed outside, therefore passed here to avoid double creation). |
|
inlinestatic |
Log a XML document. Note: Calls to this method are automatically removed from release code.
domain | The Log Domain which is combined with Scope Domains set for the Scope of invocation. |
verbosity | The verbosity. |
xDocument | the XML document to be logged. |
headLine | (Optional) The headline to log. |
lox | (Optional) The lox to log with. If null, the static member LOX of the static class Log is used. |
cln | (Optional) Caller info, compiler generated. Please omit. |
csf | (Optional) Caller info, compiler generated. Please omit. |
cmn | (Optional) Caller info, compiler generated. Please omit. |
|
inlinestatic |
Log a XML element. Note: Calls to this method are automatically removed from release code.
domain | The Log Domain which is combined with Scope Domains set for the Scope of invocation. |
verbosity | The verbosity. |
xElement | the answer node of the XML tree to be logged. |
headLine | (Optional) The headline to log. |
lox | (Optional) The lox to log with. If null, the static member LOX of the static class Log is used. |
cln | (Optional) Caller info, compiler generated. Please omit. |
csf | (Optional) Caller info, compiler generated. Please omit. |
cmn | (Optional) Caller info, compiler generated. Please omit. |
|
inlinestatic |
Log a XML document. Note: Calls to this method are automatically removed from release code.
verbosity | The verbosity. |
xDocument | the XML document to be logged. |
headLine | The headline to log. |
lox | (Optional) The lox to log with. If null, the static member LOX of the static class Log is used. |
cln | (Optional) Caller info, compiler generated. Please omit. |
csf | (Optional) Caller info, compiler generated. Please omit. |
cmn | (Optional) Caller info, compiler generated. Please omit. |
|
inlinestatic |
Log a XML element. Note: Calls to this method are automatically removed from release code.
verbosity | The verbosity. |
xElement | the answer node of the XML tree to be logged. |
headLine | The head line. |
lox | (Optional) The lox to log with. If null, the static member LOX of the static class Log is used. |
cln | (Optional) Caller info, compiler generated. Please omit. |
csf | (Optional) Caller info, compiler generated. Please omit. |
cmn | (Optional) Caller info, compiler generated. Please omit. |
|
inlinestaticprotected |
Dump a XML document into our Buffer.
xDocument | The XDocument to be logged. |
headLine | The headline to log. |
|
inlinestaticprotected |
Internal function for logging an XElement.
xe | The XElement to log. |
headLine | The headline to log. |
indent | The indentation to Log. |
|
static |
Prefix before logging out a string representation of a member because recursion limit was reached.
|
staticprotected |
This is the ThreadLock (mutex) which each method of this class uses to lock resources, e.g. the toolBuf