(index ("default-logical-connective" 0) ("define-category" 219) ("dump-categories" 503) ("start-sender" 637) ("dump-senders" 1601) ("port-sender" 1726) ("syslog-sender" 2277) ("structured-sender" 2494) ("define-output" 3077) ("default-output-format" 3639) ("push-context" 3884) ("pop-context" 4053) ("call-with-context" 4183) ("with-context" 4406) ("log-for" 4775))
(def (sig (parameter "default-logical-connective" (id default-logical-connective))) (p "As the name suggests this is the connective that is assumed, if you do not explicitly specify it in the category-specification."))
(def (sig (syntax "(define-category category-spec)" (id define-category))) (p "Syntax to define categories.  You can define simple and complex categories.") (pre "(define-category info)\n(define-category debug)\n(define-category warn)\n(define-category warn+ (or info debug warn))"))
(def (sig (procedure "(dump-categories)" (id dump-categories))) (p "Print all currently known categories to (current-output-port)."))
(def (sig (syntax "(start-sender name sender-constructor (category category-spec) [(output output-spec)])" (id start-sender))) (p "Create and register a sender for the given categories. This sender will only react on matching categories.") (ul (li (tt "name") ": A name to identify this sender") (li (tt "sender-constructor") ": One of the available constructors, see " (tt "sender-constructors")) (li (tt "category-spec") ": A specification of the categories to match in order for the sender to be applied") (li (tt "output-spec") ":  A specification of the output-formatter. See " (tt "outputs") " for details")) (pre ";;start a port-sender for the category 'model' that outputs the data as \"category message\"\n(start-sender model-sender (port-sender (current-output-port)) (output (category message)) (category model))") (pre ";;start a port-sender that matches any category\n(start-sender catchall-sender (port-sender (current-output-port)) (category *))"))
(def (sig (procedure "(dump-senders)" (id dump-senders))) (p "Print the list of all known senders to current-output-port."))
(def (sig (procedure "(port-sender port-or-path #!key (lazy #f))" (id port-sender))) (p "Creates a sender that outputs to a port. If " (tt "port-or-path") " is a port, all data will be send to this port. If " (tt "port-or-path") " is a string, it is considered a path to a file. The file will be opened and all messages will be send to this file. If " (tt "lazy") " is set to true and " (tt "port-or-path") " is a file-name, the sender will delay the opening of the file until it is actually needed, because a matching log-for statement is issued."))
(def (sig (procedure "(syslog-sender ident options facility prio)" (id syslog-sender))) (p "Creates a syslog-sender. All messages will be send to syslog with the given parameters. See also " (int-link "syslog") "."))
(def (sig (procedure "(structured-sender function)" (id structured-sender))) (p "This sender is used in structurend logging. Structured logging means that objects are than mere strings are logged. This sender accepts a function of one argument (the logged data). The function is invoked whenever the category spec of the sender matches. Be careful to only use this sender with structured output.") (pre "   (define-category struct)\n   ;;structured logging\n   (start-sender struct-sender (structured-sender (lambda (data) (print data))) (output (<structured)) (category struct))"))
(def (sig (syntax "(define-output name code)" (id define-output))) (p "Register an output with the given " (tt "name") ". The output will be generated by evaluating " (tt "code") ". During the evaluation of " (tt "code") " the following parameters will be bound.") (ul (li (tt "current-message") " The content of the message") (li (tt "current-category") " The category specification")) (p "As a convention output names start with a " (b "<") ".") (pre "(define-output <test-output (string-join (shuffle (string-split (current-message) \" \") random) \" \"))"))
(def (sig (parameter "default-output-format" (id default-output-format))) (p "This is the output-specification that is used by default when a sender is invoked. It is a list of outputs and defaults to " (b "(<context <category <message)") "."))
(def (sig (procedure "(push-context ctx)" (id push-context))) (p "Adds " (tt "ctx") " to the current stack of contexts. This makes " (tt "ctx") " the active context."))
(def (sig (procedure "(pop-context)" (id pop-context))) (p "Removes the most recently push context from the stack of contexts."))
(def (sig (procedure "(call-with-context ctx thunk)" (id call-with-context))) (p "Sets the current context to " (tt "ctx") " and invokes " (tt "thunk") ". When " (tt "thunk") " finishes it restores the previous context."))
(def (sig (syntax "(with-context ctx code)" (id with-context))) (p "This syntax is a convenient wrapper around " (tt "call-with-context") ", that adds a slightly less verbose interface.") (pre "(with-context \"Test\"\n  (log-for (app) \"This is executed withing Test-CTX\")\n  (with-context \"Nested\"\n    (log-for (app) \"This is executed in a nested Context\")))"))
(def (sig (syntax "(log-for spec fmt . args)" (id log-for))) (p "This form will invoke the logging machinery. It will find the senders that match the given " (tt "spec") ", and send the message to all senders that have a matching category-specification.") (pre "(log-for (model warn) \"just a ~A\" \"Test\")"))
