Description Usage Arguments Details Examples
When you define a handler, you specify its name and the associated action. A few predefined actions described below are provided.
1 2 3 | writeToConsole(msg, handler, ...)
writeToFile(msg, handler, ...)
|
msg |
A formated message to handle. |
handler |
The handler environment containing its options. You can register the same action to handlers with different properties. |
... |
parameters provided by logger system to interact with the action. |
A handler action is a function that accepts a formated message and handler configuration.
Messages passed are filtered already regarding loglevel.
... parameters are used by logging system to interact with the action. ... can contain dry key to inform action that it meant to initialize itself. In the case action should return TRUE if initialization succeded.
If it's not a dry run ... contain the whole preformated logging.record. A logging.record is a named list and has following structure:
contains the real formatted message
message level as numeric
message level name
name of the logger that generated it
formatted message timestamp
writeToConsole
detects if crayon package is available and uses it
to color messages. The coloring can be switched off by means of configuring
the handler with color_output option set to FALSE.
writeToFile
action expects file path to write to under
file key in handler options.
1 2 3 | ## define your own function and register it with a handler.
## author is planning a sentry client function. please send
## any interesting function you may have written!
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.