SmartLogger
FP implementation of a logger.
Created by scalaprof on 8/17/16.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Members list
Value members
Abstract methods
The function to be used for logging any thrown exceptions. Normally this will be something like the warn method of a standard logger.
The function to be used for logging any thrown exceptions. Normally this will be something like the warn method of a standard logger.
Attributes
- Returns
-
nothing
The function to be used for logging the start and end. Normally this will be something like the debug method of a standard logger.
The function to be used for logging the start and end. Normally this will be something like the debug method of a standard logger.
Attributes
- Returns
-
nothing
Concrete methods
The apply function of the SmartLogger. This method can be applied to any expression such that the start of the expression will be logged, as well as the end of the expression.
The apply function of the SmartLogger. This method can be applied to any expression such that the start of the expression will be logged, as well as the end of the expression.
Note that the type V is defined only for this method, not for the SmartLogger trait. That way we can use the same SmartLogger for any expression.
Type parameters
- V
-
the type of the expression's result
Value parameters
- f
-
the function which implements the expression
- name
-
the name (identifier) of the expression that we are logging
Attributes
- Returns
-
the result of the expression
The formatter for the end message.
The formatter for the end message.
Value parameters
- name
-
the name/identifier of the expression
- x
-
the String representing the expression's result (call-by-name so that it isn't evaluated if we don'x need it)
Attributes
- Returns
-
a String to be output. If the string is null, then no end message will be logged
A method to create an exception to be returned to the caller in the event of an exception being thrown by the expression
A method to create an exception to be returned to the caller in the event of an exception being thrown by the expression
Value parameters
- ex
-
the exception that was actually thrown
- name
-
the name/identifier of the expression
Attributes
- Returns
-
an exception which will be thrown by the apply method. Normally this will wrap the thrown exception.
log a milestone with this name and values
log a milestone with this name and values
Value parameters
- name
-
the name of this milestone
- values
-
the values to be shown for this milestone (0, 1, or N values)
Attributes
log a milestone with this number and values
log a milestone with this number and values
Value parameters
- values
-
the values to be shown for this milestone (0, 1, or N values)
- x
-
the number of this milestone
Attributes
log a milestone with the next sequential number and the given values
log a milestone with the next sequential number and the given values
Value parameters
- values
-
the values to be shown for this milestone (0, 1, or N values)
Attributes
The formatter for the milestone messages.
The formatter for the milestone messages.
Value parameters
- name
-
the name/identifier of the milestone
- values
-
the values to be output after the name
Attributes
- Returns
-
a String to be output.
The formatter for the start message.
The formatter for the start message.
Value parameters
- name
-
the name/identifier of the expression
Attributes
- Returns
-
a String to be output. If the string is null, then no start message will be logged