Liking cljdoc? Tell your friends :D

ndevreeze.logger

Simple logging functions. Similar to onelog, and also used clj-logging-config for inspiration. Now use a logger per err stream. err gets a new binding for each nRepl session, and so for each script that will run.

Simple logging functions.
Similar to onelog, and also used clj-logging-config for
inspiration. Now use a logger per *err* stream. *err* gets a new
binding for each nRepl session, and so for each script that will run.
raw docstring

closeclj

(close)

Close the currently active logger and appenders. Connected to err. Also unregister the logger

Close the currently active logger and appenders.
Connected to *err*.
Also unregister the logger
sourceraw docstring

debugclj

(debug & forms__6182__auto__)

Log function for debug

Log function for debug
sourceraw docstring

def-log-functioncljmacro

(def-log-function level)

Macro to create a logging function for a level

Macro to create a logging function for a level
sourceraw docstring

errorclj

(error & forms__6182__auto__)

Log function for error

Log function for error
sourceraw docstring

fatalclj

(fatal & forms__6182__auto__)

Log function for fatal

Log function for fatal
sourceraw docstring

get-loggerclj

(get-logger stream)

Get logger associated with (error) stream

Get logger associated with (error) stream
sourceraw docstring

infoclj

(info & forms__6182__auto__)

Log function for info

Log function for info
sourceraw docstring

initclj

(init)
(init par1)
(init logfile loglevel)

Initialises logging, possibly with a log-file.

If called with:

  • 0 parameters - init with no logfile at level :info
  • 1 parameter that is a map - see below.
  • 1 parameter that is a string or file - logfile, level will be :info
  • 2 parameters - a logfile and a log level

level - log level like :info, :debug file - give an explicit full path. Default is nil, use pattern pattern - use a pattern for the log file path, see below location - some pattern defaults/shortcuts, :home, :cwd, :script, :temp, Or a directory as string. default is nil name - script name, "script" bij default cwd - give an explicit current-working-dir, default is nil overwrite - boolean, overwrite an existing log file, default false

if all of file, pattern and location are nil, do not create a logfile, just log to the console.

To use in pattern:

  • %h = home dir
  • %c = current dir
  • %s = script dir (TBD)
  • %t = temp dir (/tmp, or c:/tmp)
  • %n = script name
  • %d = datetime, as yyyy-mm-ddTHH-MM-SS
Initialises logging, possibly with a log-file.

If called with:
- 0 parameters - init with no logfile at level :info
- 1 parameter that is a map - see below.
- 1 parameter that is a string or file - logfile, level will be :info
- 2 parameters - a logfile and a log level

level     - log level like :info, :debug
file      - give an explicit full path. Default is nil, use pattern
pattern   - use a pattern for the log file path, see below
location  - some pattern defaults/shortcuts, :home, :cwd, :script, :temp,
            Or a directory as string. default is nil
name      - script name, "script" bij default
cwd       - give an explicit current-working-dir, default is nil
overwrite - boolean, overwrite an existing log file, default false

if all of file, pattern and location are nil, do not create a
logfile, just log to the console.

To use in pattern:
 - %h = home dir
 - %c = current dir
 - %s = script dir (TBD)
 - %t = temp dir (/tmp, or c:/tmp)
 - %n = script name
 - %d = datetime, as yyyy-mm-ddTHH-MM-SS
sourceraw docstring

init-internalclj

(init-internal)
(init-internal logfile)
(init-internal logfile loglevel)

Sets a default, appwide log adapter. Optional arguments set the default logfile and loglevel. If no logfile is provided, logs to stderr only. Should be able to handle multiple init calls. Return map with keys for logger created (or re-used) and logfile name. Also register-logger!, so it can be deregistered when done. Public, used in logger_test.clj

Sets a default, appwide log adapter. Optional arguments set the
default logfile and loglevel. If no logfile is provided, logs to
stderr only.
Should be able to handle multiple init calls.
Return map with keys for logger created (or re-used) and logfile name.
Also register-logger!, so it can be deregistered when done.
Public, used in logger_test.clj
sourceraw docstring

init-with-mapclj

(init-with-map {:keys [level file pattern location overwrite]
                :as opts
                :or {level :info
                     file nil
                     pattern "%h/log/%n-%d.log"
                     location nil
                     overwrite false}})

Initialises logging, possibly with a log-file.

level - log level like :info, :debug file - give an explicit full path. Default is nil, use pattern pattern - use a pattern for the log file path, see below location - some pattern defaults/shortcuts, :home, :cwd, :script, :temp, default is nil name - script name, "script" bij default cwd - give an explicit current-working-dir, default is nil overwrite - boolean, overwrite an existing log file, default false

if all of file, pattern and location are nil, do not create a logfile, just log to the console.

Return map with keys for logger created and logfile name. logfile contains forward slashes only, even on Windows.

To use in pattern:

  • %h = home dir
  • %c = current dir
  • %s = script dir (TBD)
  • %t = temp dir (/tmp, or c:/tmp)
  • %n = script name
  • %d = datetime, as yyyy-mm-ddTHH-MM-SS
Initialises logging, possibly with a log-file.

level     - log level like :info, :debug
file      - give an explicit full path. Default is nil, use pattern
pattern   - use a pattern for the log file path, see below
location  - some pattern defaults/shortcuts, :home, :cwd, :script, :temp,
            default is nil
name      - script name, "script" bij default
cwd       - give an explicit current-working-dir, default is nil
overwrite - boolean, overwrite an existing log file, default false

if all of file, pattern and location are nil, do not create a
logfile, just log to the console.

Return map with keys for logger created and logfile name. logfile contains
forward slashes only, even on Windows.

To use in pattern:
 - %h = home dir
 - %c = current dir
 - %s = script dir (TBD)
 - %t = temp dir (/tmp, or c:/tmp)
 - %n = script name
 - %d = datetime, as yyyy-mm-ddTHH-MM-SS
sourceraw docstring

logclj

(log level forms)
(log logger level forms)

log to the logger associated with the current err stream

log to the logger associated with the current *err* stream
sourceraw docstring

to-file-location-patternclj

(to-file-location-pattern location)

Convert location (pattern shortcut) to an actual pattern for a log file. Or if location is not a keyword (but a string), treat it as a directory. Public, used in logger_test.clj

Convert location (pattern shortcut) to an actual pattern for a log file.
Or if location is not a keyword (but a string), treat it as a directory.
Public, used in logger_test.clj
sourceraw docstring

traceclj

(trace & forms__6182__auto__)

Log function for trace

Log function for trace
sourceraw docstring

warnclj

(warn & forms__6182__auto__)

Log function for warn

Log function for warn
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close