Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the simple-logger Reference Manual, version 1.0.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 15:02:30 2020 GMT+0.
• Introduction | What simple-logger is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
A simple message logging system.
This library provides a simple method of defining log messages and later showing them depending on the verbosity level.
(ql:quickload :simple-logger)
To define a log message, you use DEFINE-MESSAGE
, supplying a level, category, and message.
LEVEL
Can be one of :TRACE
, :DEBUG
, :INFO
, :WARN
, :ERROR
, or :FATAL
.
CATEGORY
A keyword symbol identifier for this message, to be referred to later when you want to
emit it.
MESSAGE
A string with the message, and any CL:FORMAT
directives you want to include.
The global logging level by default is set to :INFO
. This means that, unless the value of
*CURRENT-LEVEL*
is changed, then any messages defined with DEFINE-MESSAGE
having a level lower
than :INFO
will not be displayed when the message is emitted.
To emit a message previously defined with DEFINE-MESSAGE
, you use EMIT
, giving it the category
of the message you want to display, along with any other variables that are consumed by the
CL:FORMAT
string defined.
Example:
;; Change the global logging level to display messages with a level of :INFO or higher.
(setf *current-level* :info)
;; Define some messages.
(define-message :error :logger.example.error
"Something bad happened. Arguments: ~{~A~^, ~}")
(define-message :debug :logger.example.hidden
"This message is not displayed.")
;; Emit the example error message. This will print the following:
;; [ERROR] [2016-12-05 21:14:12] Something bad happened. Arguments: 1, 2, 3
(emit :logger.example.error '(1 2 3))
;; Emit the example debug message. This will not do anything at all because *CURRENT-LEVEL* is
;; higher than :DEBUG.
(emit :logger.example.hidden)
The global message level can be changed at a later time to start displaying messages that would have been hidden.
Copyright © 2016-2018 Michael Fiano.
Licensed under the MIT License.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The simple-logger system |
Michael Fiano <mail@michaelfiano.com>
Michael Fiano <mail@michaelfiano.com>
(:git "git@github.com:mfiano/simple-logger.git")
MIT
A simple message logging system.
# simple-logger
A simple message logging system.
## Overview
This library provides a simple method of defining log messages and later showing
them depending on the verbosity level.
## Install
“‘ lisp
(ql:quickload :simple-logger)
“‘
## Usage
To define a log message, you use ‘DEFINE-MESSAGE‘, supplying a level, category, and message.
‘LEVEL‘ Can be one of ‘:TRACE‘, ‘:DEBUG‘, ‘:INFO‘, ‘:WARN‘, ‘:ERROR‘, or ‘:FATAL‘.
‘CATEGORY‘ A keyword symbol identifier for this message, to be referred to later when you want to
emit it.
‘MESSAGE‘ A string with the message, and any ‘CL:FORMAT‘ directives you want to include.
The global logging level by default is set to ‘:INFO‘. This means that, unless the value of
‘*CURRENT-LEVEL*‘ is changed, then any messages defined with ‘DEFINE-MESSAGE‘ having a level lower
than ‘:INFO‘ will not be displayed when the message is emitted.
To emit a message previously defined with ‘DEFINE-MESSAGE‘, you use ‘EMIT‘, giving it the category
of the message you want to display, along with any other variables that are consumed by the
‘CL:FORMAT‘ string defined.
Example:
“‘ lisp
;; Change the global logging level to display messages with a level of :INFO or higher.
(setf *current-level* :info)
;; Define some messages.
(define-message :error :logger.example.error
"Something bad happened. Arguments: ~{~A~^, ~}")
(define-message :debug :logger.example.hidden
"This message is not displayed.")
;; Emit the example error message. This will print the following:
;; [ERROR] [2016-12-05 21:14:12] Something bad happened. Arguments: 1, 2, 3
(emit :logger.example.error ’(1 2 3))
;; Emit the example debug message. This will not do anything at all because *CURRENT-LEVEL* is
;; higher than :DEBUG.
(emit :logger.example.hidden)
“‘
The global message level can be changed at a later time to start displaying messages that would have
been hidden.
## License
Copyright © 2016-2018 [Michael Fiano](mailto:mail@michaelfiano.com).
Licensed under the MIT License.
1.0.0
simple-logger.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The simple-logger.asd file | ||
• The simple-logger/package.lisp file | ||
• The simple-logger/logger.lisp file |
Next: The simple-logger/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
/home/quickref/quicklisp/dists/quicklisp/software/simple-logger-20180228-git/simple-logger.asd
simple-logger (system)
Next: The simple-logger/logger․lisp file, Previous: The simple-logger․asd file, Up: Lisp files [Contents][Index]
simple-logger (system)
package.lisp
Previous: The simple-logger/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
simple-logger (system)
logger.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The simple-logger package |
package.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported special variables | ||
• Exported macros | ||
• Exported generic functions |
Next: Exported macros, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
The logging level to use. Can be one of: :TRACE, :DEBUG, :INFO, :WARN, :ERROR, :FATAL
logger.lisp (file)
Next: Exported generic functions, Previous: Exported special variables, Up: Exported definitions [Contents][Index]
Macro for defining a message to be emitted later.
logger.lisp (file)
Previous: Exported macros, Up: Exported definitions [Contents][Index]
Emit the message defined with the given name.
logger.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables | ||
• Internal functions |
Next: Internal functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
logger.lisp (file)
Previous: Internal special variables, Up: Internal definitions [Contents][Index]
The current timestamp string formatted for display in a message.
logger.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L S |
---|
Jump to: | F L S |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | D E F G M |
---|
Jump to: | D E F G M |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
S |
---|
Jump to: | *
S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | P S |
---|
Jump to: | P S |
---|