Liking cljdoc? Tell your friends :D

onelog.core

Batteries-included logging for Clojure. You can require this one file and begin logging, with no further configuration necessary.

BUG - TODO: Fix so that (set-default-logger!) gets called automatically if the user tries to log without calling it first.

TODO: Add profiling methods (i.e. run a function and log how long it took)

Batteries-included logging for Clojure. You can require this one
file and begin logging, with no further configuration necessary.


BUG - TODO: Fix so that (set-default-logger!) gets called automatically if
the user tries to log without calling it first.

TODO: Add profiling methods (i.e. run a function and log how long it took)
raw docstring

*appender-fn*clj

source

*copy-to-console*clj

source

*error-color*clj

source

*logfile*clj

source

*loglevel*clj

source

*warn-color*clj

source

appender-for-fileclj

(appender-for-file logfile)

Returns a FileAppender for the given file.

Returns a FileAppender for the given file.
sourceraw docstring

colorclj

(color colors & data)

ANSI colorizes the given data and returns it.

The first argument is a either a color specifier as per clansi.core, or a collection of color specifiers. For example, :white or [:bright :white] are valid

Subsequent arguments are concatenated into a string.

Examples:

(log/error (log/color [:bright :red] "foo")) (log/error (log/color :red "foo"))

ANSI colorizes the given data and returns it.

 The first argument is a either a color specifier as per clansi.core, or a collection
 of color specifiers. For example, :white or [:bright :white] are valid

Subsequent arguments are concatenated into a string.

 Examples:

   (log/error (log/color [:bright :red] "foo"))
   (log/error (log/color :red "foo"))
sourceraw docstring

debugclj

(debug & forms)
source

debug+clj

source

debugging-log-prefix-formatclj

source

errorclj

(error & forms)
source

error+clj

source

fatalclj

(fatal & forms)
source

fatal+clj

source

infoclj

(info & forms)
source

info+clj

source

initializedclj

source

plus-loggercljmacro

(plus-logger logger-sym)

Defines a new logger function called by the given symbol name suffixed with a plus. This function copies forms given to it to STDERR in addition to logging them at the specified level.

For example, (plus-logger info) creates a function called info+. Calling (info+ "foo") is the same as calling (info "foo"), except that the message will be written to STDERR in addition to logged at the :info level.

Defines a new logger function called by the given symbol name suffixed with a plus.
 This function copies forms given to it to STDERR in addition to
logging them at the specified level.

 For example, (plus-logger info) creates a function called
info+. Calling (info+ "foo") is the same as calling (info "foo"),
except that the message will be written to STDERR in addition to
logged at the :info level.  
sourceraw docstring

println-stderrclj

(println-stderr & forms)
source

production-log-prefix-formatclj

source

root-causeclj

(root-cause tr)

Returns the last 'cause' Throwable in a chain of Throwables. (From http://clojuredocs.org/clojure_core/clojure.stacktrace/root-cause)

Returns the last 'cause' Throwable in a chain of Throwables.
(From http://clojuredocs.org/clojure_core/clojure.stacktrace/root-cause)
sourceraw docstring

rotating-loggerclj

(rotating-logger logfile)
source

set-debug!clj

(set-debug!)
source

set-default-logger!clj

(set-default-logger! & args)

Deprecated old name for start!.

Deprecated old name for start!.
sourceraw docstring

set-info!clj

(set-info!)
source

set-log-level!clj

(set-log-level! level)

Sets the global log level to the given level. Levels are keywords

  • :debug, :info, :warn, etc.
Sets the global log level to the given level. Levels are keywords
- :debug, :info, :warn, etc.
sourceraw docstring

set-namespace-logger!clj

(set-namespace-logger! logfile)
(set-namespace-logger! ns log-level log-adapter)
source

set-trace!clj

(set-trace!)
source

set-warn!clj

(set-warn!)
source

spycljmacro

(spy & forms)

Evaluates the given forms, logs their result at debug level, and then returns their result. You can then take a given form and insert a (spy (foo)) around it to trace its operation.

Evaluates the given forms, logs their result at debug level, and then
returns their result. You can then take a given form and insert
a (spy (foo)) around it to trace its operation.
sourceraw docstring

spy+cljmacro

(spy+ & forms)

Like spy, but copies messages to STDERR in addition to logging them.

Like spy, but copies messages to STDERR in addition to logging them.
sourceraw docstring

stacktraceclj

(stacktrace throwable)

Converts a Throwable into a sequence of strings with the stacktrace.

Converts a Throwable into a sequence of strings with the stacktrace.
sourceraw docstring

start!clj

(start!)
(start! logfile)
(start! logfile loglevel)
(start! logfile loglevel force)

Sets a default, appwide log adapter. Optional arguments set the default logfile and loglevel. If no logfile is provided, logs to log/clojure.log from the current working directory.

If 'initialized' is true, does nothing unless 'force' is true. This is so that multiple libraries can all call this in the same project and share the same logfile, while each also specifying a default logfile for itself when used separately.

Sets a default, appwide log adapter. Optional arguments set the
default logfile and loglevel. If no logfile is provided, logs to
log/clojure.log from the current working directory.

If 'initialized' is true, does nothing unless 'force' is true. This is
so that multiple libraries can all call this in the same project and
share the same logfile, while each also specifying a default logfile
for itself when used separately.
sourceraw docstring

throwableclj

(throwable tr)

Renders a single Throwable into string form. Includes the class name, message, and the stacktrace.

If there is a chain of causes present, also logs the root cause.

Renders a single Throwable into string form. Includes the class name,
 message, and the stacktrace.

If there is a chain of causes present, also logs the root cause.
sourceraw docstring

traceclj

(trace & forms)
source

trace+clj

source

warnclj

(warn & forms)
source

warn+clj

source

with-consolecljmacro

(with-console & forms)

Executes the given code block with all log messages copied to STDOUT in addition to logging them.

Executes the given code block with all log messages copied to
STDOUT in addition to logging them.
sourceraw docstring

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

× close