-
Notifications
You must be signed in to change notification settings - Fork 11
Logging
Attila Szabo edited this page Dec 22, 2023
·
1 revision
- In
Aardvark.Basethere is the static classReportwhich is used to log something and logging can be configured - The log output is defined by
Report.Targetswhich is aMultiLogTargetand has aConsoleLogTargetandLogTarget(log file) as default -
Report.LogFileNamesets the file for theLogTargetand the default is "Aardvark.log" right next to the startup location (needs to be set before first log output) -
Report.Verbositylets 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
ILogTargetto for example redirect the Aardvark logging to another output
-
Report.LineReport.WarnReport.Errorare the most common functions found in: Report.cs - They work like
String.Formatwhere you can pass a format string and an arbitrary list of arguments - A log line starts with a thread identifier
-
Report.Valueallows to log variable values more conveniently -
Report.BeginReport.Endallows to group/indent logging in between (e.g. byReport.Line) -
Report.BeginTimedReport.EndTimedorReport.End(works both) also measure the timing of the block -
Report.BeginTimedNoLogwill 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/Endbe careful to make sure they are identical - Advanced features
Report.ProgressReport.Job
- There are F# style counterparts of
Report.*theLogmodule: Logging.fs -
Log.lineLog.warnLog.error -
Log.startLog.startTimedLog.stop