From 31b7cdbf3444b3ac46a0e1828f1b51cd5d585c4b Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 13 Feb 2012 00:18:49 +0000 Subject: [PATCH] LazLogger: docs git-svn-id: trunk@35344 - --- .gitattributes | 1 + docs/xml/lazutils/lazlogger.xml | 222 ++++++++++++++++++++++++++++++++ 2 files changed, 223 insertions(+) create mode 100644 docs/xml/lazutils/lazlogger.xml diff --git a/.gitattributes b/.gitattributes index 5e71f84347..4655437e86 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3154,6 +3154,7 @@ docs/xml/lazutils/laz_xmlwrite.xml svneol=native#text/plain docs/xml/lazutils/lazdbglog.xml svneol=native#text/plain docs/xml/lazutils/lazfilecache.xml svneol=native#text/plain docs/xml/lazutils/lazfileutils.xml svneol=native#text/plain +docs/xml/lazutils/lazlogger.xml svneol=native#text/xml docs/xml/lazutils/lazmethodlist.xml svneol=native#text/plain docs/xml/lazutils/lazutf16.xml svneol=native#text/plain docs/xml/lazutils/lazutf8.xml svneol=native#text/plain diff --git a/docs/xml/lazutils/lazlogger.xml b/docs/xml/lazutils/lazlogger.xml new file mode 100644 index 0000000000..c2636f1cba --- /dev/null +++ b/docs/xml/lazutils/lazlogger.xml @@ -0,0 +1,222 @@ + + + + + + Write message to log + +

Writes the text to the log. Does not append a new line. +

+

The Argument can be:

+

One or more string

+

An open array of const: All values are converted to string and joined

+

A single string and open array of const: Will be passed to Format

+

Any of the above with a PLazLoggerLogGroup as filter

+

This is a forwarder to the log TLazLogger object. See there for details.

+
+ + DebugLogger + +
+ + Write message to log + +

Writes the text to the log. Does append a new line. +

+

The Argument can be:

+

One or more string

+

An open array of const: All values are converted to string and joined

+

A single string and open array of const: Will be passed to Format

+

Any of the above with a PLazLoggerLogGroup as filter

+

This is a forwarder to the log TLazLogger object. See there for details.

+
+ + DebugLogger + +
+ + Write message to log + +

Writes the text to the log. Does append a new line. Increases the current intend. +

+

The Argument can be:

+

One or more string

+

An open array of const: All values are converted to string and joined

+

A single string and open array of const: Will be passed to Format

+

Any of the above with a PLazLoggerLogGroup as filter

+

This is a forwarder to the log TLazLogger object. See there for details.

+
+ + DebugLogger + +
+ + Write message to log + +

Writes the text to the log. Does append a new line. Increases the current intend. +

+

The Argument can be:

+

One or more string

+

An open array of const: All values are converted to string and joined

+

A single string and open array of const: Will be passed to Format

+

Any of the above with a PLazLoggerLogGroup as filter

+

This is a forwarder to the log TLazLogger object. See there for details.

+
+ + DebugLogger + +
+ + A log writer object + +

Provides functionality to write messages to a log file. Allows filtering and changing indent level. +

+

Can parse options from command line for log filename and filter settings. +

+

An application can subclass the logger to add it's own functionality +

+
+
+ + The name of the log file + This can be set by the application. + +Alternatively it can be determined according to ParamForLogFileName and EnvironmentForLogFileName + + + Name of the command line option, that has the logfile's name + If LogName is empty and this is set, then the commandline will be checked for a param of the name specified. LogName will be set, if found. + +The default is --debug-log= +Note that the dashes and equal sign must be present. + + + Write message to log + +

Writes the text to the log. Does not append a new line. +

+

The Argument can be:

+

One or more string

+

An open array of const: All values are converted to string and joined

+

A single string and open array of const: Will be passed to Format

+

Any of the above with a PLazLoggerLogGroup as filter

+
+ + DebugLogger + +
+ + Write message to log + +

Writes the text to the log. Does append a new line. +

+

The Argument can be:

+

One or more string

+

An open array of const: All values are converted to string and joined

+

A single string and open array of const: Will be passed to Format

+

Any of the above with a PLazLoggerLogGroup as filter

+
+ + DebugLogger + +
+ + Write message to log + +

Writes the text to the log. Does append a new line. Increases the current intend. +

+

The Argument can be:

+

One or more string

+

An open array of const: All values are converted to string and joined

+

A single string and open array of const: Will be passed to Format

+

Any of the above with a PLazLoggerLogGroup as filter

+
+ + DebugLogger + +
+ + Write message to log + +

Writes the text to the log. Does append a new line. Increases the current intend. +

+

The Argument can be:

+

One or more string

+

An open array of const: All values are converted to string and joined

+

A single string and open array of const: Will be passed to Format

+

Any of the above with a PLazLoggerLogGroup as filter

+
+ + DebugLogger + +
+ + + Name of the environment, that has the logfile's name + If LogName is empty and con not be found from ParamForLogFileName, then the environment variable specified will be checked. + LogName will be set, if found. + +* will be replaced by param(0) + +The default is: *_debuglog + + + + Enable writing to STDOUT, if LogName is not set + + + Enable opening and closing the log for each write + + + Event when writing a full line (Debugln, DebuglnEnter or DebuglnExit) + The event contains the text to be logged. +It also has a handled var param, that can be set to True to prevent default action (writing to log) + + + Event when writing without line end (DbgOut) + The event contains the text to be logged. +It also has a handled var param, that can be set to True to prevent default action (writing to log) + + + Indent to be added for each DebuglnEnter + Default is 2 + + + Maxmum indent for DebuglnEnter + If the indent reaches this value, it will not increase anymore. Instead each line is prefixed with the nest-level of DebuglnEnter + +Default is 15 + + + Register a named filter + var + MyFilter: PLazLoggerLogGroup; + +initialization + MyFilter := DebugLogger.RegisterLogGroup('MyFilterName'); + +then write + debugln(MyFilter, ['Notice: ', SomeText]); + + +The filter can be enabled via the command line. See ParamForEnabledLogGroups + + + Name of the command line option, to enable or disable LogGroups + + + List of all LogGroups + + Provides a log framework + LazLogger provides logging facilities to write message to a file. +Messages can be logged plain, or enclosed in begin/end like blocks, adding indent to all messages between to points (blocks can be nested). +It also has the ability to filter groups of messages. + +It can reads the command line and environment to find the desired filename. By default it looks for --debug-log= on the command line or "appname"_debuglog in environment. + +If no log name is found StdOut is used. + +The simples usage, is to use the unit and put "DebugLn"/ "DbgOut" / "DebugLnEnter"/ "DebugLnExit" in your code. This works without any further setup. +
+
+