-
Notifications
You must be signed in to change notification settings - Fork 9
Logging
Attila Szabo edited this page Dec 22, 2023
·
1 revision
- In
Aardvark.Base
there is the static classReport
which is used to log something and logging can be configured - The log output is defined by
Report.Targets
which is aMultiLogTarget
and has aConsoleLogTarget
andLogTarget
(log file) as default -
Report.LogFileName
sets the file for theLogTarget
and the default is "Aardvark.log" right next to the startup location (needs to be set before first log output) -
Report.Verbosity
lets you control the verbosity ofConsoleLogTarget
(in general each log target has its own verbosity) - You can add/remove targets as you like
- A target needs to implement
ILogTarget
to for example redirect the Aardvark logging to another output
-
Report.Line
Report.Warn
Report.Error
are the most common functions found in: Report.cs - They work like
String.Format
where you can pass a format string and an arbitrary list of arguments - A log line starts with a thread identifier
-
Report.Value
allows to log variable values more conveniently -
Report.Begin
Report.End
allows to group/indent logging in between (e.g. byReport.Line
) -
Report.BeginTimed
Report.EndTimed
orReport.End
(works both) also measure the timing of the block -
Report.BeginTimedNoLog
will only report the timing using the message inReport.End
, this avoids interleaved outputs in multithreading - All report functions have an optional verbosity, in case you use
Begin/End
be careful to make sure they are identical - Advanced features
Report.Progress
Report.Job
- There are F# style counterparts of
Report.*
theLog
module: Logging.fs -
Log.line
Log.warn
Log.error
-
Log.start
Log.startTimed
Log.stop