Constructor
defaults to Warn
Optional
chainedLogger: null | ILoggerServiceReference to another ILoggerService implementation that gets called after the console's logging.
Control which levels are output.
Control which levels are output.
When true, logError() adds the call stack taken from the Error object. Defaults to false.
Reference to another ILogger implementation that gets called after the console's logging. Optional. Will only be called if this logger instance has level >= minLevel or an override. Its own MinLevel will be changed to Debug because this logger expects chainedLogger to output all log entries. However, you can set the minLevel on chainedLogger after this assignment to control what it outputs.
Reference to another ILogger implementation that gets called after the console's logging. Optional. Will only be called if this logger instance has level >= minLevel or an override. Its own MinLevel will be changed to Debug because this logger expects chainedLogger to output all log entries. However, you can set the minLevel on chainedLogger after this assignment to control what it outputs.
Protected
overridesUser supplied overrides for the minLevel rule.
Count of log entries captured.
If the log entry matches the criteria, the minimum level is overridden. Note that by adding an entry here, you are turning off lazying loading on error messages, as the lazy load function must be called to check the criteria.
Create a new log entry if the level is at or above the minimum level. The function is only called if the level is at or above the minimum level, avoiding any processing that would be done to create its data. The intent is to be performant when the log level is set to a higher level.
Protected
matchLooks through all overrideMinLevelWhens in order found. If overrideMinLevelWhen contain all matching values, it is a match and true is returned.
the log level to match.
the log details to match.
true if a match is found, false if no match is found.
Create a new log entry for an error object. It is always added, because the Error object is always LoggingLevel.Error. The Error object has most of the info needed
Protected
addProtected
writeDirects the data in logDetails to the actual logging destination.
Protected
getSupplies the logOptions used in the callbacks.
Looks for a log that contains any of the criteria in the parameters. All criteria must match for a log to be found.
a string or RegExp to match against the message. When null, it is not used. When string, it is a partial case insensitivie match.
Optional
logLevel: null | LoggingLevelthe log level to match. When null/undefined, it is not used.
Optional
category: null | stringthe category to match. When null/undefined, it is not used.
Optional
more: FindMoreCapturedLogDetailsadditional filters to apply: type, feature, identity, hasData, data.
true when a matching log is found, false otherwise.
Looks through all captures in order found. If any contain all matching values, it is returned. messageSegment and sourceSegment allow a partial match (case insensitive). Null parameters are not used for searching.
a string or RegExp to match against the message. When null, it is not used. When string, it is a partial case insensitivie match.
Optional
logLevel: null | LoggingLevelthe log level to match. When null/undefined, it is not used.
Optional
category: null | stringthe category to match. When null/undefined, it is not used.
Optional
more: FindMoreCapturedLogDetailsadditional filters to apply: type, feature, identity, hasData, data.
the first matching capture or null if none found.
Generated using TypeDoc v0.25.12
CapturingLogger targets testing jivs. It captures all qualifying logged objects and makes them available for unit tests to evaluate.
Use either its containsLog() or findMessage() methods to search for a log that matches the criteria.
It respects the minLevel set in the constructor and supports the overrideMinLevelWhen() overrides.
It is often used together with ConsoleLoggerService to capture logs. Just pass the ConsoleLoggerService into the constructor.