Telemere 1.0.0-beta7
Released under the Eclipse Public License - v 1.0
Structured telemetry library for Clojure/Script.
Installation
To install, add the following dependency to your project or build file:
[com.taoensso/telemere "1.0.0-beta7"]
Namespaces
taoensso.telemere
Structured telemetry for Clojure/Script applications.
Public variables and functions:
- *ctx*
- *middleware*
- add-handler!
- catch->error!
- chance
- check-intakes
- comp-middleware
- default-ctx
- error!
- error-signal?
- event!
- format-signal-fn
- get-env
- get-filters
- get-handlers
- get-min-level
- handler:console
- handler:file
- help:filters
- help:handlers
- help:signal-content
- help:signal-creators
- help:signal-filters
- help:signal-flow
- help:signal-handlers
- help:signal-options
- level-aliases
- log!
- msg-skip
- msg-splice
- newline
- pr-signal-fn
- rate-limiter
- remove-handler!
- set-ctx!
- set-id-filter!
- set-kind-filter!
- set-middleware!
- set-min-level!
- set-ns-filter!
- set-var-root!
- shut-down-handlers!
- signal!
- spy!
- streams->reset!
- streams->telemere!
- trace!
- uncaught->error!
- uncaught->handler!
- update-var-root!
- with-ctx
- with-ctx+
- with-err->telemere
- with-handler
- with-handler+
- with-id-filter
- with-kind-filter
- with-middleware
- with-min-level
- with-ns-filter
- with-out->telemere
- with-signal
- with-signals
- with-streams->telemere
- without-filters
taoensso.telemere.open-telemetry
OpenTelemetry handler using `opentelemetry-java`, +Telemere 1.0.0-beta8 \ No newline at end of file diff --git a/index.cljs.html b/index.cljs.html index f98fc72..fffdc8e 100644 --- a/index.cljs.html +++ b/index.cljs.html @@ -1,4 +1,4 @@ -Telemere 1.0.0-beta8
Released under the Eclipse Public License - v 1.0
Structured telemetry library for Clojure/Script.
Installation
To install, add the following dependency to your project or build file:
[com.taoensso/telemere "1.0.0-beta8"]Namespaces
taoensso.telemere
Structured telemetry for Clojure/Script applications.Public variables and functions:
- *ctx*
- *middleware*
- add-handler!
- catch->error!
- chance
- check-intakes
- comp-middleware
- default-ctx
- error!
- error-signal?
- event!
- format-signal-fn
- get-env
- get-filters
- get-handlers
- get-min-level
- handler:console
- handler:file
- help:filters
- help:handlers
- help:signal-content
- help:signal-creators
- help:signal-filters
- help:signal-flow
- help:signal-handlers
- help:signal-options
- level-aliases
- log!
- msg-skip
- msg-splice
- newline
- pr-signal-fn
- rate-limiter
- remove-handler!
- set-ctx!
- set-id-filter!
- set-kind-filter!
- set-middleware!
- set-min-level!
- set-ns-filter!
- set-var-root!
- shut-down-handlers!
- signal!
- spy!
- streams->reset!
- streams->telemere!
- trace!
- uncaught->error!
- uncaught->handler!
- update-var-root!
- with-ctx
- with-ctx+
- with-err->telemere
- with-handler
- with-handler+
- with-id-filter
- with-kind-filter
- with-middleware
- with-min-level
- with-ns-filter
- with-out->telemere
- with-signal
- with-signals
- with-streams->telemere
- without-filters
taoensso.telemere.open-telemetry
OpenTelemetry handler using `opentelemetry-java`, Ref. <https://github.com/open-telemetry/opentelemetry-java>.Public variables and functions:
taoensso.telemere.postal
Email handler using `postal`, -Ref. <https://github.com/drewr/postal>.Public variables and functions:
taoensso.telemere.streams
Intake support for standard stream/s -> Telemere.Public variables and functions:
taoensso.telemere.timbre
Main Timbre macros, reimplemented on top of Telemere. +Ref. <https://github.com/drewr/postal>.Public variables and functions:
taoensso.telemere.slack
Slack handler using `clj-slack`, +Ref. <https://github.com/julienXX/clj-slack>Public variables and functions:
taoensso.telemere.streams
Intake support for standard stream/s -> Telemere.Public variables and functions:
taoensso.telemere.timbre
Main Timbre macros, reimplemented on top of Telemere. Intended to help ease migration from Timbre to Telemere.Public variables and functions:
taoensso.telemere.tools-logging
Intake support for `clojure.tools.logging` -> Telemere. Telemere will attempt to load this ns automatically when possible.Public variables and functions:
taoensso.telemere.utils
Misc utils useful for Telemere handlers, middleware, etc.Public variables and functions:
Telemere 1.0.0-beta7 Telemere 1.0.0-beta7
Released under the Eclipse Public License - v 1.0
Structured telemetry library for Clojure/Script.
Installation
To install, add the following dependency to your project or build file:
[com.taoensso/telemere "1.0.0-beta7"]Namespaces
taoensso.telemere
Structured telemetry for Clojure/Script applications.Public variables and functions:
- *ctx*
- *middleware*
- add-handler!
- catch->error!
- chance
- comp-middleware
- default-ctx
- error!
- error-signal?
- event!
- format-signal-fn
- get-env
- get-filters
- get-handlers
- get-min-level
- handler:console
- handler:console-raw
- help:filters
- help:handlers
- help:signal-content
- help:signal-creators
- help:signal-filters
- help:signal-flow
- help:signal-handlers
- help:signal-options
- level-aliases
- log!
- msg-skip
- msg-splice
- newline
- pr-signal-fn
- rate-limiter
- remove-handler!
- set-ctx!
- set-id-filter!
- set-kind-filter!
- set-middleware!
- set-min-level!
- set-ns-filter!
- set-var-root!
- shut-down-handlers!
- signal!
- spy!
- trace!
- uncaught->error!
- update-var-root!
- with-ctx
- with-ctx+
- with-err->telemere
- with-handler
- with-handler+
- with-id-filter
- with-kind-filter
- with-middleware
- with-min-level
- with-ns-filter
- with-out->telemere
- with-signal
- with-signals
- with-streams->telemere
- without-filters
taoensso.telemere.timbre
Main Timbre macros, reimplemented on top of Telemere. +Telemere 1.0.0-beta8 \ No newline at end of file diff --git a/index.html b/index.html index 275bd0d..8d67cb1 100644 --- a/index.html +++ b/index.html @@ -1,3 +1,3 @@ -Telemere 1.0.0-beta8
Released under the Eclipse Public License - v 1.0
Structured telemetry library for Clojure/Script.
Installation
To install, add the following dependency to your project or build file:
[com.taoensso/telemere "1.0.0-beta8"]Namespaces
taoensso.telemere
Structured telemetry for Clojure/Script applications.Public variables and functions:
- *ctx*
- *middleware*
- add-handler!
- catch->error!
- chance
- comp-middleware
- default-ctx
- error!
- error-signal?
- event!
- format-signal-fn
- get-env
- get-filters
- get-handlers
- get-min-level
- handler:console
- handler:console-raw
- help:filters
- help:handlers
- help:signal-content
- help:signal-creators
- help:signal-filters
- help:signal-flow
- help:signal-handlers
- help:signal-options
- level-aliases
- log!
- msg-skip
- msg-splice
- newline
- pr-signal-fn
- rate-limiter
- remove-handler!
- set-ctx!
- set-id-filter!
- set-kind-filter!
- set-middleware!
- set-min-level!
- set-ns-filter!
- set-var-root!
- shut-down-handlers!
- signal!
- spy!
- trace!
- uncaught->error!
- update-var-root!
- with-ctx
- with-ctx+
- with-err->telemere
- with-handler
- with-handler+
- with-id-filter
- with-kind-filter
- with-middleware
- with-min-level
- with-ns-filter
- with-out->telemere
- with-signal
- with-signals
- with-streams->telemere
- without-filters
taoensso.telemere.timbre
Main Timbre macros, reimplemented on top of Telemere. Intended to help ease migration from Timbre to Telemere.Public variables and functions:
taoensso.telemere.utils
Misc utils useful for Telemere handlers, middleware, etc.Telemere 1.0.0-beta7 \ No newline at end of file +Telemere 1.0.0-beta7
Released under the Eclipse Public License - v 1.0
Structured telemetry library for Clojure/Script.
Installation
To install, add the following dependency to your project or build file:
[com.taoensso/telemere "1.0.0-beta7"]Platforms
This project includes code for multiple platforms, please choose a platform to view its documentation:
Telemere 1.0.0-beta8 \ No newline at end of file diff --git a/taoensso.telemere.cljs.html b/taoensso.telemere.cljs.html index 71ae315..e9083d1 100644 --- a/taoensso.telemere.cljs.html +++ b/taoensso.telemere.cljs.html @@ -1,6 +1,6 @@ -Telemere 1.0.0-beta8
Released under the Eclipse Public License - v 1.0
Structured telemetry library for Clojure/Script.
Installation
To install, add the following dependency to your project or build file:
[com.taoensso/telemere "1.0.0-beta8"]Platforms
This project includes code for multiple platforms, please choose a platform to view its documentation:
taoensso.telemere documentation taoensso.telemere
Structured telemetry for Clojure/Script applications. +taoensso.telemere documentation taoensso.telemere
Structured telemetry for Clojure/Script applications. See the GitHub page (esp. Wiki) for info on motivation and design: <https://www.taoensso.com/telemere>*ctx*
dynamic
clj
cljs
Dynamic context: arbitrary user-level state attached as `:ctx` to all signals. @@ -18,7 +18,7 @@ Tips: - Value may be of form {<scope-id> <data>} for custom scoping, etc.*middleware*
dynamic
clj
cljs
Optional (fn [signal]) => ?modified-signal to apply (once) when signal is created. When middleware returns nil, skips all handlers. -Compose multiple middleware fns together with `comp-middleware. +Compose multiple middleware fns together with `comp-middleware`. Re/bind dynamic value using `with-middleware`, `binding`. Modify root (base) value using `set-middleware!`.add-handler!
clj
cljs
(add-handler! handler-id handler-fn)(add-handler! handler-id handler-fn dispatch-opts)Registers given signal handler and returns @@ -235,8 +235,13 @@ Tips: [3] See `help:signal-content` - {:keys [kind level id data ...]} [4] See `help:signal-flow` - (filters, handling, etc.)format-signal-fn
clj
cljs
(format-signal-fn)(format-signal-fn {:keys [incl-newline? preamble-fn content-fn], :or {incl-newline? true, preamble-fn (signal-preamble-fn), content-fn (signal-content-fn)}})Experimental, subject to change. Returns a (fn format [signal]) that: - - Takes a Telemere signal. - - Returns human-readable formatted string. + - Takes a Telemere signal (map). + - Returns a human-readable signal string. + +Options: + `:incl-newline?` - Include terminating system newline? (default true) + `:preamble-fn` - (fn [signal]) => signal preamble string. + `:content-fn` - (fn [signal]) => signal content string. See also `pr-signal-fn` for machine-readable output.get-env
macro
clj
cljs
added in Encore v3.75.0 (2024-01-29)
(get-env {:keys [as default return], :or {as :str, return :value}} spec)Flexible cross-platform util for embedding a config value during macro expansion. Used by other Taoensso libraries. @@ -293,24 +298,28 @@ TIP!: Use the {:return :explain} option in tests or at the REPL to verify/inspec resulting config value, config source, and specific search order of prop/env/res ids.get-handlers
clj
cljs
(get-handlers)Returns ?{<handler-id> {:keys [dispatch-opts handler-fn]}} for all registered signal handlers.get-min-level
clj
cljs
(get-min-level)(get-min-level kind)(get-min-level kind ns)Returns current ?{:keys [compile-time runtime]} minimum levels. -handler:console
clj
cljs
(handler:console)(handler:console {:keys [output-fn], :or {output-fn (utils/format-signal-fn)}})Experimental, subject to change. Feedback welcome! +handler:console
clj
cljs
(handler:console)(handler:console {:keys [output-fn], :or {output-fn (utils/format-signal-fn)}})Experimental, subject to change. If `js/console` exists, returns a (fn handler [signal]) that: - - Takes a Telemere signal. - - Writes formatted signal string to JavaScript console. + - Takes a Telemere signal (map). + - Writes the signal as a string to JavaScript console. A general-purpose `println`-style handler that's well suited for outputting -signals formatted as edn, JSON, or human-readable strings. +signals as human or machine-readable (edn, JSON) strings. Options: - `:output-fn` - (fn [signal]) => output string, see `format-signal-fn` or `pr-signal-fn`handler:console-raw
cljs
(handler:console-raw)(handler:console-raw {:keys [preamble-fn format-nsecs-fn], :as opts, :or {preamble-fn (utils/signal-preamble-fn), format-nsecs-fn (utils/format-nsecs-fn)}})Experimental, subject to change. Feedback welcome! + `:output-fn` - (fn [signal]) => string, see `format-signal-fn` or `pr-signal-fn`handler:console-raw
cljs
(handler:console-raw)(handler:console-raw {:keys [preamble-fn format-nsecs-fn], :as opts, :or {preamble-fn (utils/signal-preamble-fn), format-nsecs-fn (utils/format-nsecs-fn)}})Experimental, subject to change. If `js/console` exists, returns a (fn handler [signal]) that: - - Takes a Telemere signal. - - Writes raw signal data to JavaScript console. + - Takes a Telemere signal (map). + - Writes the raw signal to JavaScript console. Intended for use with browser formatting tools like `binaryage/devtools`, -Ref. <https://github.com/binaryage/cljs-devtools>.help:filters
clj
cljs
Your filter config determines which signal calls will be allowed. +Ref. <https://github.com/binaryage/cljs-devtools>. + +Options: + `:preamble-fn` - (fn [signal]) => string. + `:format-nsecs-fn` - (fn [nanosecs]) => string.help:filters
clj
cljs
Your filter config determines which signal calls will be allowed. Filtering can occur at compile-time, runtime, or both. Compile-time filtering elides (permanently removes!) code for @@ -600,13 +609,15 @@ Useful for conditionally splicing in extra message content, etc.: %> {:msg_ "Username: Steve"}pr-signal-fn
clj
cljs
(pr-signal-fn pr-fn)(pr-signal-fn pr-fn {:keys [incl-thread? incl-kvs? incl-newline? prep-fn], :or {incl-newline? true, prep-fn (comp error-in-signal->maps minify-signal)}})Experimental, subject to change. -Returns a (fn pr-signal [signal]) that: - - Takes a Telemere signal. - - Returns machine-readable serialized string of the (minified) signal. +Returns a (fn pr [signal]) that: + - Takes a Telemere signal (map). + - Returns a machine-readable (minified) signal string. -Options include: - `pr-fn` ∈ #{<unary-fn> :edn :json (Cljs only)} - See arglists for more. +Options: + `pr-fn` - ∈ #{<unary-fn> :edn :json (Cljs only)} + `:incl-thread?` - Include signal `:thread` info? (default false) + `:incl-kvs?` - Include signal `:kvs` info? (default false) + `:incl-newline?` - Include terminating system newline? (default true) Examples: (pr-signal-fn :edn {<opts>}) @@ -838,11 +849,11 @@ Executes given form, trapping errors. Returns the LAST signal created by form. Useful for tests/debugging. Options: - `trap-signals?` (default: false) + `trap-signals?` (default false) Should ALL signals created by form be trapped to prevent normal dispatch to registered handlers? - `raw-msg?` (default: false) + `raw-msg?` (default false) Should delayed `:msg_` in returned signal be retained as-is? Delay is otherwise replaced by realized string. diff --git a/taoensso.telemere.html b/taoensso.telemere.html index a9717fe..8d5ba7e 100644 --- a/taoensso.telemere.html +++ b/taoensso.telemere.html @@ -1,6 +1,6 @@ -taoensso.telemere documentation taoensso.telemere
Structured telemetry for Clojure/Script applications. +taoensso.telemere documentation taoensso.telemere
Structured telemetry for Clojure/Script applications. See the GitHub page (esp. Wiki) for info on motivation and design: <https://www.taoensso.com/telemere>*ctx*
dynamic
clj
cljs
Dynamic context: arbitrary user-level state attached as `:ctx` to all signals. @@ -18,7 +18,7 @@ Tips: - Value may be of form {<scope-id> <data>} for custom scoping, etc.*middleware*
dynamic
clj
cljs
Optional (fn [signal]) => ?modified-signal to apply (once) when signal is created. When middleware returns nil, skips all handlers. -Compose multiple middleware fns together with `comp-middleware. +Compose multiple middleware fns together with `comp-middleware`. Re/bind dynamic value using `with-middleware`, `binding`. Modify root (base) value using `set-middleware!`.add-handler!
clj
cljs
(add-handler! handler-id handler-fn)(add-handler! handler-id handler-fn dispatch-opts)Registers given signal handler and returns @@ -239,8 +239,13 @@ Tips: [3] See `help:signal-content` - {:keys [kind level id data ...]} [4] See `help:signal-flow` - (filters, handling, etc.)format-signal-fn
clj
cljs
(format-signal-fn)(format-signal-fn {:keys [incl-newline? preamble-fn content-fn], :or {incl-newline? true, preamble-fn (signal-preamble-fn), content-fn (signal-content-fn)}})Experimental, subject to change. Returns a (fn format [signal]) that: - - Takes a Telemere signal. - - Returns human-readable formatted string. + - Takes a Telemere signal (map). + - Returns a human-readable signal string. + +Options: + `:incl-newline?` - Include terminating system newline? (default true) + `:preamble-fn` - (fn [signal]) => signal preamble string. + `:content-fn` - (fn [signal]) => signal content string. See also `pr-signal-fn` for machine-readable output.get-env
macro
clj
cljs
added in Encore v3.75.0 (2024-01-29)
(get-env {:keys [as default return], :or {as :str, return :value}} spec)Flexible cross-platform util for embedding a config value during macro expansion. Used by other Taoensso libraries. @@ -297,29 +302,30 @@ TIP!: Use the {:return :explain} option in tests or at the REPL to verify/inspec resulting config value, config source, and specific search order of prop/env/res ids.get-handlers
clj
cljs
(get-handlers)Returns ?{<handler-id> {:keys [dispatch-opts handler-fn]}} for all registered signal handlers.get-min-level
clj
cljs
(get-min-level)(get-min-level kind)(get-min-level kind ns)Returns current ?{:keys [compile-time runtime]} minimum levels. -handler:console
clj
cljs
(handler:console)(handler:console {:keys [output-fn stream], :or {output-fn (utils/format-signal-fn)}})Experimental, subject to change. Feedback welcome! +handler:console
clj
cljs
(handler:console)(handler:console {:keys [output-fn stream], :or {output-fn (utils/format-signal-fn)}})Experimental, subject to change. Returns a (fn handler [signal]) that: - - Takes a Telemere signal. - - Writes formatted signal string to stream. + - Takes a Telemere signal (map). + - Writes the signal as a string to specified stream. A general-purpose `println`-style handler that's well suited for outputting -signals formatted as edn, JSON, or human-readable strings. +signals as human or machine-readable (edn, JSON) strings. Options: - `:output-fn` - (fn [signal]) => output string, see `format-signal-fn` or `pr-signal-fn` + `:output-fn` - (fn [signal]) => string, see `format-signal-fn` or `pr-signal-fn` `:stream` - `java.io.writer` - Defaults to `*err*` if `utils/error-signal?` is true, and `*out*` otherwise.handler:file
clj
(handler:file)(handler:file {:keys [output-fn path interval max-file-size max-num-parts max-num-intervals gzip-archives?], :or {output-fn (utils/format-signal-fn), path "logs/telemere.log", interval :monthly, max-file-size (* 1024 1024 4), max-num-parts 8, max-num-intervals 6, gzip-archives? true}})Experimental, subject to change. Feedback welcome! + Defaults to `*err*` if `utils/error-signal?` is true, and `*out*` otherwise.handler:file
clj
(handler:file)(handler:file {:keys [output-fn path interval max-file-size max-num-parts max-num-intervals gzip-archives?], :or {output-fn (utils/format-signal-fn), path "logs/telemere.log", interval :monthly, max-file-size (* 1024 1024 4), max-num-parts 8, max-num-intervals 6, gzip-archives? true}})Experimental, subject to change. - Returns a (fn handler [signal]) that: - - Takes a Telemere signal. - - Writes formatted signal string to file. +Returns a (fn handler [signal]) that: + - Takes a Telemere signal (map). + - Writes (appends) the signal as a string to file specified by `path`. -Signals will be appended to file specified by `path`. Depending on options, archives may be maintained: - `logs/app.log.n.gz` (for nil `:interval`, non-nil `:max-file-size`) - `logs/app.log-YYYY-MM-DDd.n.gz` (for non-nil `:interval`) ; d=daily/w=weekly/m=monthly +Can output signals as human or machine-readable (edn, JSON) strings. + Example files with default options: `/logs/telemere.log` ; Current file `/logs/telemere.log-2020-01-01m.1.gz` ; Archive for Jan 2020, part 1 (newest entries) @@ -327,7 +333,7 @@ Example files with default options: `/logs/telemere.log-2020-01-01m.8.gz` ; Archive for Jan 2020, part 8 (oldest entries) Options: - `:output-fn`- (fn [signal]) => output string, see `format-signal-fn` or `pr-signal-fn` + `:output-fn`- (fn [signal]) => string, see `format-signal-fn` or `pr-signal-fn` `:path` - Path string of the target output file (default `logs/telemere.log`) `:interval` - ∈ #{nil :daily :weekly :monthly} (default `:monthly`) @@ -731,13 +737,15 @@ Useful for conditionally splicing in extra message content, etc.: %> {:msg_ "Username: Steve"}pr-signal-fn
clj
cljs
(pr-signal-fn pr-fn)(pr-signal-fn pr-fn {:keys [incl-thread? incl-kvs? incl-newline? prep-fn], :or {incl-newline? true, prep-fn (comp error-in-signal->maps minify-signal)}})Experimental, subject to change. -Returns a (fn pr-signal [signal]) that: - - Takes a Telemere signal. - - Returns machine-readable serialized string of the (minified) signal. +Returns a (fn pr [signal]) that: + - Takes a Telemere signal (map). + - Returns a machine-readable (minified) signal string. -Options include: - `pr-fn` ∈ #{<unary-fn> :edn :json (Cljs only)} - See arglists for more. +Options: + `pr-fn` - ∈ #{<unary-fn> :edn :json (Cljs only)} + `:incl-thread?` - Include signal `:thread` info? (default false) + `:incl-kvs?` - Include signal `:kvs` info? (default false) + `:incl-newline?` - Include terminating system newline? (default true) Examples: (pr-signal-fn :edn {<opts>}) @@ -825,7 +833,7 @@ Examples: - {:allow <spec> :deny <spec>} with specs as above. If present, `:allow` spec MUST match, AND If present, `:deny` spec MUST NOT match.set-var-root!
macro
clj
cljs
added in Encore v3.75.0 (2024-01-29)
(set-var-root! var-sym root-val)Sets root binding (value) of the var identified by given symbol, and returns -the new value. Cross-platform. See also `update-var-root!`.shut-down-handlers!
clj
cljs
(shut-down-handlers!)(shut-down-handlers! timeout-msecs__8468__auto__)Shuts down all registered signal handlers in parallel, and returns +the new value. Cross-platform. See also `update-var-root!`.shut-down-handlers!
clj
cljs
(shut-down-handlers!)(shut-down-handlers! timeout-msecs__8469__auto__)Shuts down all registered signal handlers in parallel, and returns ?{<handler-id> {:keys [okay error]}}. Future calls to handlers will no-op. @@ -985,11 +993,11 @@ Executes given form, trapping errors. Returns the LAST signal created by form. Useful for tests/debugging. Options: - `trap-signals?` (default: false) + `trap-signals?` (default false) Should ALL signals created by form be trapped to prevent normal dispatch to registered handlers? - `raw-msg?` (default: false) + `raw-msg?` (default false) Should delayed `:msg_` in returned signal be retained as-is? Delay is otherwise replaced by realized string. diff --git a/taoensso.telemere.open-telemetry.html b/taoensso.telemere.open-telemetry.html index 2150a11..1f96339 100644 --- a/taoensso.telemere.open-telemetry.html +++ b/taoensso.telemere.open-telemetry.html @@ -1,6 +1,6 @@ -taoensso.telemere.open-telemetry documentation taoensso.telemere.open-telemetry
OpenTelemetry handler using `opentelemetry-java`, +taoensso.telemere.open-telemetry documentation taoensso.telemere.open-telemetry
OpenTelemetry handler using `opentelemetry-java`, Ref. <https://github.com/open-telemetry/opentelemetry-java>.default-logger-provider
clj
(default-logger-provider)Experimental, subject to change. Feedback welcome! Returns `io.opentelemetry.api.logs.LoggerProvider` via: @@ -13,9 +13,9 @@ Needs `opentelemetry-java`, Ref. <https://github.com/open-telemetry/opentelemetry-java>. Returns a (fn handler [signal]) that: - - Takes a Telemere signal. - - Emits signal content to the `io.opentelemetry.api.logs.Logger` - returned by given `io.opentelemetry.api.logs.LoggerProvider`. + - Takes a Telemere signal (map). + - Emits the signal to `io.opentelemetry.api.logs.Logger` returned + by given `io.opentelemetry.api.logs.LoggerProvider`. Options: `:logger-provider` - `io.opentelemetry.api.logs.LoggerProvider` diff --git a/taoensso.telemere.postal.html b/taoensso.telemere.postal.html index ae32762..7080c74 100644 --- a/taoensso.telemere.postal.html +++ b/taoensso.telemere.postal.html @@ -1,30 +1,34 @@ -taoensso.telemere.postal documentation taoensso.telemere.postal
Email handler using `postal`, -Ref. <https://github.com/drewr/postal>.a-handler:postal
clj
(a-handler:postal)(a-handler:postal signal)handler:postal
clj
(handler:postal)(handler:postal {:keys [postal/conn-opts postal/msg-opts subject-fn body-fn], :or {subject-fn (signal-subject-fn), body-fn (utils/format-signal-fn)}})Experimental, subject to change. Feedback welcome! +taoensso.telemere.postal documentation \ No newline at end of file diff --git a/taoensso.telemere.slack.html b/taoensso.telemere.slack.html new file mode 100644 index 0000000..68556d8 --- /dev/null +++ b/taoensso.telemere.slack.html @@ -0,0 +1,36 @@ + +taoensso.telemere.postal
Email handler using `postal`, +Ref. <https://github.com/drewr/postal>.default-dispatch-opts
clj
handler:postal
clj
(handler:postal {:keys [conn-opts msg-opts subject-fn body-fn], :or {subject-fn (signal-subject-fn), body-fn (utils/format-signal-fn)}})Experimental, subject to change. -Needs `postal`, - Ref. <https://github.com/drewr/postal>. +Needs `postal`, Ref. <https://github.com/drewr/postal>. Returns a (fn handler [signal]) that: - - Takes a Telemere signal. - - Sends formatted signal string as email to specified recipient. + - Takes a Telemere signal (map). + - Sends the signal as an email to specified recipient. Useful for emailing important alerts to admins, etc. -NB can incur financial costs!! -See tips section re: protecting against unexpected costs. +Default handler dispatch options (override when calling `add-handler!`): + `:min-level` - `:info` + `:rate-limit` - + [[5 (enc/msecs :mins 1)] ; Max 5 emails in 1 min + [10 (enc/msecs :mins 15)] ; Max 10 emails in 15 mins + [15 (enc/msecs :hours 1)] ; Max 15 emails in 1 hour + [30 (enc/msecs :hours 6)] ; Max 30 emails in 6 hours + ] Options: - - `:postal/conn-opts` - Map of connection opts provided to `postal` + `:conn-opts` - Map of connection opts given to `postal/send-message` Examples: {:host "mail.isp.net", :user "jsmith", :pass "a-secret"}, {:host "smtp.gmail.com", :user "jsmith@gmail.com", :pass "a-secret" :port 587 :tls true}, - {:host "email-smtp.us-east-1.amazonaws.com", :port 587, :tls true - :user "AKIAIDTP........" :pass "AikCFhx1P......."} + {:host "email-smtp.us-east-1.amazonaws.com", :port 587, :tls true, + :user "AKIAIDTP........", :pass "AikCFhx1P......."} - `:postal/msg-opts` - Map of message options + `:msg-opts` - Map of message opts given to `postal/send-message` Examples: {:from "foo@example.com", :to "bar@example.com"}, {:from "Alice <foo@example.com", :to "Bob <bar@example.com>"}, @@ -34,28 +38,14 @@ Options: :X-MyHeader "A custom header"} `:subject-fn` - (fn [signal]) => email subject string - `:body-fn` - (fn [signal]) => email body content string, see `format-signal-fn` or `pr-signal-fn` + `:body-fn` - (fn [signal]) => email body content string, + see `format-signal-fn` or `pr-signal-fn` Tips: - - - Sending emails can incur financial costs! - Use appropriate dispatch filtering options when calling `add-handler!` to prevent - handler from sending unnecessary emails! - - At least ALWAYS set an appropriate `:rate-limit` option, e.g.: - (add-handler! :my-postal-handler (handler:postal {<my-handler-opts}) - {:rate-limit {"Max 1 per min" [1 (enc/msecs :mins 1)] - "Max 3 per 15 mins" [3 (enc/msecs :mins 15)] - "Max 5 per hour" [5 (enc/msecs :hours 1)]}, ...}), etc. - - - Sending emails is slow! - Use appropriate async dispatch options when calling `add-handler!` to prevent - handler from blocking signal creator calls, e.g.: - (add-handler! :my-postal-handler (handler:postal {<my-handler-opts>}) - {:async {:mode :dropping, :buffer-size 128, :n-threads 4} ...}), etc. - - - Ref. <https://github.com/drewr/postal> for more info on `postal` options.signal-subject-fn
clj
(signal-subject-fn)(signal-subject-fn {:keys [max-len subject-signal-key], :or {max-len 128, subject-signal-key :postal/subject}})Experimental, subject to change. + - Ref. <https://github.com/drewr/postal> for more info on `postal` options. + - Sending emails can be slow, and can incur financial costs! + Use appropriate handler dispatch options for async handling and rate limiting, etc.signal-subject-fn
clj
(signal-subject-fn)(signal-subject-fn {:keys [max-len subject-signal-key], :or {max-len 128, subject-signal-key :postal/subject}})Experimental, subject to change. Returns a (fn format [signal]) that: - - Takes a Telemere signal. - - Returns a formatted email subject like: + - Takes a Telemere signal (map). + - Returns an email subject string like: "INFO EVENT :taoensso.telemere.postal/ev-id1 - msg"taoensso.telemere.slack documentation \ No newline at end of file diff --git a/taoensso.telemere.sockets.html b/taoensso.telemere.sockets.html index d439924..3be573e 100644 --- a/taoensso.telemere.sockets.html +++ b/taoensso.telemere.sockets.html @@ -1,34 +1,41 @@ -taoensso.telemere.slack
Slack handler using `clj-slack`, +Ref. <https://github.com/julienXX/clj-slack>default-dispatch-opts
clj
handler:slack
clj
(handler:slack {:keys [conn-opts post-opts output-fn], :or {conn-opts {:api-url "https://slack.com/api", :token nil}, post-opts {:channel-id nil, :username nil}, output-fn (utils/format-signal-fn)}})Experimental, subject to change. + +Needs `clj-slack`, Ref. <https://github.com/julienXX/clj-slack>. + +Returns a (fn handler [signal]) that: + - Takes a Telemere signal (map). + - Writes the signal as a string to specified Slack channel. + +Can output signals as human or machine-readable (edn, JSON) strings. + +Default handler dispatch options (override when calling `add-handler!`): + `:min-level` - `:info` + `:rate-limit` - + [[5 (enc/msecs :mins 1)] ; Max 5 posts in 1 min + [10 (enc/msecs :mins 15)] ; Max 10 posts in 15 mins + [15 (enc/msecs :hours 1)] ; Max 15 posts in 1 hour + [30 (enc/msecs :hours 6)] ; Max 30 posts in 6 hours + ] + +Options: + `:conn-opts` - Map of connection opts given to `clj-slack.chat/post-message` + Examples: + {:token "MY-TOKEN"} + {:token "MY-TOKEN", :api-url "https://slack.com/api"} + + `:post-opts` - Map of post opts given to `clj-slack.chat/post-message` + Examples: + {:channel-id "C12345678", :username "MY_BOT"} + + `:output-fn` - (fn [signal]) => string, see `format-signal-fn` or `pr-signal-fn` + +Tips: + - See `clj-slack` docs for more info on its options.taoensso.telemere.sockets documentation taoensso.telemere.sockets
Basic TCP/UDP socket handlers. -a-handler:tcp-socket
clj
(a-handler:tcp-socket)(a-handler:tcp-socket signal)a-handler:udp-socket
clj
(a-handler:udp-socket)(a-handler:udp-socket signal)handler:tcp-socket
clj
(handler:tcp-socket host port)(handler:tcp-socket host port {:keys [socket-opts output-fn], :or {output-fn (utils/format-signal-fn)}})Experimental, subject to change. Feedback welcome! +taoensso.telemere.sockets documentation taoensso.telemere.sockets
Basic TCP/UDP socket handlers. +handler:tcp-socket
clj
(handler:tcp-socket {:keys [socket-opts output-fn], :or {output-fn (utils/format-signal-fn)}})Experimental, subject to change. Returns a (fn handler [signal]) that: - - Takes a Telemere signal. - - Sends formatted signal string to specified TCP socket. + - Takes a Telemere signal (map). + - Sends the signal as a string to specified TCP socket. + +Can output signals as human or machine-readable (edn, JSON) strings. Options: - `host` - Destination TCP socket hostname string - `port` - Destination TCP socket port int + `:socket-opts` - {:keys [host port ssl? connect-timeout-msecs]} + `:host` - Destination TCP socket hostname string + `:port` - Destination TCP socket port int + `:ssl?` - Use SSL/TLS (default false) + `:connect-timeout-msecs` - Connection timeout (default 3000 msecs) - `:socket-opts` - {:keys [ssl? connect-timeout-msecs]} - `:output-fn` - (fn [signal]) => output string, see `format-signal-fn` or `pr-signal-fn` + `:output-fn` - (fn [signal]) => string, see `format-signal-fn` or `pr-signal-fn` Limitations: - Failed writes will be retried only once. - Writes lock on a single underlying socket, so IO won't benefit from adding - extra handler threads. Let me know if there's demand for socket pooling.handler:udp-socket
clj
(handler:udp-socket host port)(handler:udp-socket host port {:keys [output-fn max-packet-bytes truncation-warning-fn], :or {output-fn (utils/format-signal-fn), max-packet-bytes 512}})Experimental, subject to change. Feedback welcome! + extra handler threads. Let me know if there's demand for socket pooling.handler:udp-socket
clj
(handler:udp-socket {:keys [socket-opts output-fn truncation-warning-fn], :or {socket-opts {:max-packet-bytes 512}, output-fn (utils/format-signal-fn)}})Experimental, subject to change. Feedback welcome! Returns a (fn handler [signal]) that: - - Takes a Telemere signal. - - Sends formatted signal string to specified UDP socket. + - Takes a Telemere signal (map). + - Sends the signal as a string to specified UDP socket. + +Can output signals as human or machine-readable (edn, JSON) strings. Options: - `host` - Destination UDP socket hostname string - `port` - Destination UDP socket port int + `:socket-opts` - {:keys [host port max-packet-bytes]} + `:host` - Destination UDP socket hostname string + `:port` - Destination UDP socket port int + `:max-packet-bytes` - Max packet size (in bytes) before truncating output (default 512) - `:output-fn` - (fn [signal]) => output string, see `format-signal-fn` or `pr-signal-fn` - `:max-packet-bytes` - Max packet size (in bytes) before truncating output (default 512) + `:output-fn` - (fn [signal]) => string, see `format-signal-fn` or `pr-signal-fn` `:truncation-warning-fn` - Optional (fn [{:keys [max actual signal]}]) to call whenever output is truncated. Should be appropriately rate-limited! diff --git a/taoensso.telemere.streams.html b/taoensso.telemere.streams.html index 6fbd7a2..e886aba 100644 --- a/taoensso.telemere.streams.html +++ b/taoensso.telemere.streams.html @@ -1,6 +1,6 @@ -taoensso.telemere.streams documentation taoensso.telemere.streams
Intake support for standard stream/s -> Telemere. +taoensso.telemere.streams documentation taoensso.telemere.streams
Intake support for standard stream/s -> Telemere.check-err-intake
clj
(check-err-intake)Returns {:keys [sending->telemere? telemere-receiving?]}.check-out-intake
clj
(check-out-intake)Returns {:keys [sending->telemere? telemere-receiving?]}.streams->reset!
clj
(streams->reset!)Experimental, subject to change. diff --git a/taoensso.telemere.timbre.cljs.html b/taoensso.telemere.timbre.cljs.html index ce0fdde..d209ce9 100644 --- a/taoensso.telemere.timbre.cljs.html +++ b/taoensso.telemere.timbre.cljs.html @@ -1,6 +1,6 @@ -taoensso.telemere.timbre documentation taoensso.telemere.timbre
Main Timbre macros, reimplemented on top of Telemere. +taoensso.telemere.timbre documentation \ No newline at end of file diff --git a/taoensso.telemere.timbre.html b/taoensso.telemere.timbre.html index 271d6cd..f0be6e6 100644 --- a/taoensso.telemere.timbre.html +++ b/taoensso.telemere.timbre.html @@ -1,6 +1,6 @@ -taoensso.telemere.timbre
Main Timbre macros, reimplemented on top of Telemere. Intended to help ease migration from Timbre to Telemere.taoensso.telemere.timbre documentation taoensso.telemere.timbre
Main Timbre macros, reimplemented on top of Telemere. +taoensso.telemere.timbre documentation taoensso.telemere.timbre
Main Timbre macros, reimplemented on top of Telemere. Intended to help ease migration from Timbre to Telemere.debug
macro
clj
(debug & args)Prefer `telemere/log!`, etc.debugf
macro
clj
(debugf & args)Prefer `telemere/log!`, etc.error
macro
clj
(error & args)Prefer `telemere/log!`, etc. diff --git a/taoensso.telemere.tools-logging.html b/taoensso.telemere.tools-logging.html index a0794da..c3424f2 100644 --- a/taoensso.telemere.tools-logging.html +++ b/taoensso.telemere.tools-logging.html @@ -1,6 +1,6 @@ -taoensso.telemere.tools-logging documentation taoensso.telemere.tools-logging
Intake support for `clojure.tools.logging` -> Telemere. +taoensso.telemere.tools-logging documentation taoensso.telemere.tools-logging
Intake support for `clojure.tools.logging` -> Telemere. Telemere will attempt to load this ns automatically when possible.check-intake
clj
(check-intake)Returns {:keys [present? sending->telemere? telemere-receiving?]}.\ No newline at end of file diff --git a/taoensso.telemere.utils.html b/taoensso.telemere.utils.html index a90d704..1c4c5ba 100644 --- a/taoensso.telemere.utils.html +++ b/taoensso.telemere.utils.html @@ -1,14 +1,13 @@ -tools-logging->telemere!
clj
(tools-logging->telemere!)Configures `clojure.tools.logging` to use Telemere as its logging implementation. diff --git a/taoensso.telemere.utils.cljs.html b/taoensso.telemere.utils.cljs.html index 0316bc2..f348fcb 100644 --- a/taoensso.telemere.utils.cljs.html +++ b/taoensso.telemere.utils.cljs.html @@ -1,6 +1,6 @@ -taoensso.telemere.utils documentation taoensso.telemere.utils
\ No newline at end of file +Options: + `:format-inst-fn` - (fn format [instant]) => string.Misc utils useful for Telemere handlers, middleware, etc. +taoensso.telemere.utils documentation taoensso.telemere.utils
Misc utils useful for Telemere handlers, middleware, etc.error-in-signal->maps
clj
cljs
(error-in-signal->maps signal)Experimental, subject to change. Returns given signal with possible `:error` replaced by [{:keys [type msg data]} ...] cause chain. @@ -10,11 +10,11 @@ Returns true iff given signal has an `:error` value, or a `:kind` or `:level` that indicates that it's an error.format-error-fn
clj
cljs
(format-error-fn)(format-error-fn {:as _opts})Experimental, subject to change. Returns a (fn format [error]) that: - Takes a platform error (`Throwable` or `js/Error`). - - Returns a formatted human-readable stringformat-inst-fn
clj
cljs
added in Encore v3.98.0 (2024-04-08)
(format-inst-fn)(format-inst-fn {:keys [formatter]})Experimental, subject to change without notice. + - Returns a human-readable error string.format-inst-fn
clj
cljs
added in Encore v3.98.0 (2024-04-08)
(format-inst-fn)(format-inst-fn {:keys [formatter]})Experimental, subject to change without notice. Returns a (fn format [instant]) that: - Takes a platform instant (`java.time.Instant` or `js/Date`). - - Returns a formatted human-readable string. + - Returns a formatted human-readable instant string. Options: `:zone` (Clj only) `java.time.ZoneOffset` (defaults to UTC). @@ -26,11 +26,16 @@ Options: e.g.: "2011-12-03T10:15:130Z".format-nsecs-fn
clj
cljs
(format-nsecs-fn)(format-nsecs-fn {:as _opts})Experimental, subject to change. Returns a (fn format [nanosecs]) that: - Takes a long nanoseconds (e.g. runtime). - - Returns a formatted human-readable string like: + - Returns a human-readable string like: "1.00m", "4.20s", "340ms", "822μs", etc.format-signal-fn
clj
cljs
(format-signal-fn)(format-signal-fn {:keys [incl-newline? preamble-fn content-fn], :or {incl-newline? true, preamble-fn (signal-preamble-fn), content-fn (signal-content-fn)}})Experimental, subject to change. Returns a (fn format [signal]) that: - - Takes a Telemere signal. - - Returns human-readable formatted string. + - Takes a Telemere signal (map). + - Returns a human-readable signal string. + +Options: + `:incl-newline?` - Include terminating system newline? (default true) + `:preamble-fn` - (fn [signal]) => signal preamble string. + `:content-fn` - (fn [signal]) => signal content string. See also `pr-signal-fn` for machine-readable output.js-console-logger
cljs
(js-console-logger level)Returns JavaScript console logger to match given signal level: `:trace` -> `js/console.trace`, @@ -38,7 +43,7 @@ See also `pr-signal-fn` for machine-readable output.minify-signal
clj
cljs
(minify-signal signal)Experimental, subject to change. -Returns minimal signal map, removing: +Returns minimal signal, removing: - Keys with nil values, and - Keys with redundant values (`:kvs`, `:location`, `:file`). @@ -46,13 +51,15 @@ Useful when serializing signals to edn/JSON/etc.pr-json
cljs
added in Encore v3.98.0 (2024-04-08)
(pr-json x)Returns given Cljs argument as JSON string.pr-signal-fn
clj
cljs
(pr-signal-fn pr-fn)(pr-signal-fn pr-fn {:keys [incl-thread? incl-kvs? incl-newline? prep-fn], :or {incl-newline? true, prep-fn (comp error-in-signal->maps minify-signal)}})Experimental, subject to change. -Returns a (fn pr-signal [signal]) that: - - Takes a Telemere signal. - - Returns machine-readable serialized string of the (minified) signal. +Returns a (fn pr [signal]) that: + - Takes a Telemere signal (map). + - Returns a machine-readable (minified) signal string. -Options include: - `pr-fn` ∈ #{<unary-fn> :edn :json (Cljs only)} - See arglists for more. +Options: + `pr-fn` - ∈ #{<unary-fn> :edn :json (Cljs only)} + `:incl-thread?` - Include signal `:thread` info? (default false) + `:incl-kvs?` - Include signal `:kvs` info? (default false) + `:incl-newline?` - Include terminating system newline? (default true) Examples: (pr-signal-fn :edn {<opts>}) @@ -63,16 +70,22 @@ Examples: (require '[jsonista.core :as jsonista]) (pr-signal-fn jsonista/write-value-as-string {<opts>}) -See also `format-signal-fn` for human-readable output.remove-kvs
clj
cljs
(remove-kvs signal)Returns the given signal without user-level kvs. +See also `format-signal-fn` for human-readable output.signal-content-fn
clj
cljs
(signal-content-fn)(signal-content-fn {:keys [incl-thread? incl-kvs? raw-error? format-nsecs-fn format-error-fn], :or {format-nsecs-fn (format-nsecs-fn), format-error-fn (format-error-fn)}})Experimental, subject to change. Returns a (fn content [signal]) that: - - Takes a Telemere signal. - - Returns a signal content ?string (incl. data, ctx, etc.) + - Takes a Telemere signal (map). + - Returns a signal content ?string (incl. data, ctx, etc.). -See arglists for options.signal-preamble-fn
clj
cljs
(signal-preamble-fn)(signal-preamble-fn {:keys [format-inst-fn], :or {format-inst-fn (format-inst-fn)}})Experimental, subject to change. +Options: + `:incl-thread?` - Include signal `:thread` info? (default false) + `:incl-kvs?` - Include signal `:kvs` info? (default false) + `:raw-error?` - Retain unformatted error? (default false) + `:format-nsecs-fn` - (fn [nanosecs]) => string. + `:format-error-fn` - (fn [error]) => string.signal-preamble-fn
clj
cljs
(signal-preamble-fn)(signal-preamble-fn {:keys [format-inst-fn], :or {format-inst-fn (format-inst-fn)}})Experimental, subject to change. Returns a (fn preamble [signal]) that: - - Takes a Telemere signal. + - Takes a Telemere signal (map). - Returns a signal preamble ?string like: "2024-03-26T11:14:51.806Z INFO EVENT Hostname taoensso.telemere(2,21) ::ev-id - msg" -See arglists for options.taoensso.telemere.utils documentation taoensso.telemere.utils
Misc utils useful for Telemere handlers, middleware, etc. +taoensso.telemere.utils documentation taoensso.telemere.utils
Misc utils useful for Telemere handlers, middleware, etc.error-in-signal->maps
clj
cljs
(error-in-signal->maps signal)Experimental, subject to change. Returns given signal with possible `:error` replaced by [{:keys [type msg data]} ...] cause chain. Useful when serializing signals to edn/JSON/etc.error-signal?
clj
cljs
(error-signal? signal)Experimental, subject to change. Returns true iff given signal has an `:error` value, or a `:kind` or `:level` -that indicates that it's an error.file-writer
clj
(file-writer file append?)Experimental, subject to change. Feedback welcome! - +that indicates that it's an error.file-writer
clj
(file-writer {:keys [file append?], :or {append? true}})Experimental, subject to change. Opens the specified file and returns a stateful fn of 2 arities: [content] => Writes given content to file, or no-ops if closed. [] => Closes the writer. @@ -22,11 +21,11 @@ Notes: - Thread safe, locks on single file stream.format-error-fn
clj
cljs
(format-error-fn)(format-error-fn {:as _opts})Experimental, subject to change. Returns a (fn format [error]) that: - Takes a platform error (`Throwable` or `js/Error`). - - Returns a formatted human-readable stringformat-inst-fn
clj
cljs
added in Encore v3.98.0 (2024-04-08)
(format-inst-fn)(format-inst-fn {:keys [formatter zone], :or {formatter java.time.format.DateTimeFormatter/ISO_INSTANT, zone java.time.ZoneOffset/UTC}})Experimental, subject to change without notice. + - Returns a human-readable error string.format-inst-fn
clj
cljs
added in Encore v3.98.0 (2024-04-08)
(format-inst-fn)(format-inst-fn {:keys [formatter zone], :or {formatter java.time.format.DateTimeFormatter/ISO_INSTANT, zone java.time.ZoneOffset/UTC}})Experimental, subject to change without notice. Returns a (fn format [instant]) that: - Takes a platform instant (`java.time.Instant` or `js/Date`). - - Returns a formatted human-readable string. + - Returns a formatted human-readable instant string. Options: `:zone` (Clj only) `java.time.ZoneOffset` (defaults to UTC). @@ -38,29 +37,36 @@ Options: e.g.: "2011-12-03T10:15:130Z".format-nsecs-fn
clj
cljs
(format-nsecs-fn)(format-nsecs-fn {:as _opts})Experimental, subject to change. Returns a (fn format [nanosecs]) that: - Takes a long nanoseconds (e.g. runtime). - - Returns a formatted human-readable string like: + - Returns a human-readable string like: "1.00m", "4.20s", "340ms", "822μs", etc.format-signal-fn
clj
cljs
(format-signal-fn)(format-signal-fn {:keys [incl-newline? preamble-fn content-fn], :or {incl-newline? true, preamble-fn (signal-preamble-fn), content-fn (signal-content-fn)}})Experimental, subject to change. Returns a (fn format [signal]) that: - - Takes a Telemere signal. - - Returns human-readable formatted string. + - Takes a Telemere signal (map). + - Returns a human-readable signal string. + +Options: + `:incl-newline?` - Include terminating system newline? (default true) + `:preamble-fn` - (fn [signal]) => signal preamble string. + `:content-fn` - (fn [signal]) => signal content string. See also `pr-signal-fn` for machine-readable output.host-ip
clj
(host-ip timeout-msecs timeout-val)(host-ip)Returns cached local host IP address string, or `timeout-val` (default "UnknownHost").hostname
clj
(hostname timeout-msecs timeout-val)(hostname)Returns cached local hostname string, or `timeout-val` (default "UnknownHost").minify-signal
clj
cljs
(minify-signal signal)Experimental, subject to change. -Returns minimal signal map, removing: +Returns minimal signal, removing: - Keys with nil values, and - Keys with redundant values (`:kvs`, `:location`, `:file`). Useful when serializing signals to edn/JSON/etc.pr-signal-fn
clj
cljs
(pr-signal-fn pr-fn)(pr-signal-fn pr-fn {:keys [incl-thread? incl-kvs? incl-newline? prep-fn], :or {incl-newline? true, prep-fn (comp error-in-signal->maps minify-signal)}})Experimental, subject to change. -Returns a (fn pr-signal [signal]) that: - - Takes a Telemere signal. - - Returns machine-readable serialized string of the (minified) signal. +Returns a (fn pr [signal]) that: + - Takes a Telemere signal (map). + - Returns a machine-readable (minified) signal string. -Options include: - `pr-fn` ∈ #{<unary-fn> :edn :json (Cljs only)} - See arglists for more. +Options: + `pr-fn` - ∈ #{<unary-fn> :edn :json (Cljs only)} + `:incl-thread?` - Include signal `:thread` info? (default false) + `:incl-kvs?` - Include signal `:kvs` info? (default false) + `:incl-newline?` - Include terminating system newline? (default true) Examples: (pr-signal-fn :edn {<opts>}) @@ -71,20 +77,25 @@ Examples: (require '[jsonista.core :as jsonista]) (pr-signal-fn jsonista/write-value-as-string {<opts>}) -See also `format-signal-fn` for human-readable output.remove-kvs
clj
cljs
(remove-kvs signal)Returns the given signal without user-level kvs. +See also `format-signal-fn` for human-readable output.signal-content-fn
clj
cljs
(signal-content-fn)(signal-content-fn {:keys [incl-thread? incl-kvs? raw-error? format-nsecs-fn format-error-fn], :or {format-nsecs-fn (format-nsecs-fn), format-error-fn (format-error-fn)}})Experimental, subject to change. Returns a (fn content [signal]) that: - - Takes a Telemere signal. - - Returns a signal content ?string (incl. data, ctx, etc.) + - Takes a Telemere signal (map). + - Returns a signal content ?string (incl. data, ctx, etc.). -See arglists for options.signal-preamble-fn
clj
cljs
(signal-preamble-fn)(signal-preamble-fn {:keys [format-inst-fn], :or {format-inst-fn (format-inst-fn)}})Experimental, subject to change. +Options: + `:incl-thread?` - Include signal `:thread` info? (default false) + `:incl-kvs?` - Include signal `:kvs` info? (default false) + `:raw-error?` - Retain unformatted error? (default false) + `:format-nsecs-fn` - (fn [nanosecs]) => string. + `:format-error-fn` - (fn [error]) => string.signal-preamble-fn
clj
cljs
(signal-preamble-fn)(signal-preamble-fn {:keys [format-inst-fn], :or {format-inst-fn (format-inst-fn)}})Experimental, subject to change. Returns a (fn preamble [signal]) that: - - Takes a Telemere signal. + - Takes a Telemere signal (map). - Returns a signal preamble ?string like: "2024-03-26T11:14:51.806Z INFO EVENT Hostname taoensso.telemere(2,21) ::ev-id - msg" -See arglists for options.tcp-socket-writer
clj
(tcp-socket-writer host port {:keys [ssl? connect-timeout-msecs socket-fn ssl-socket-fn], :as opts, :or {connect-timeout-msecs 3000, socket-fn default-socket-fn, ssl-socket-fn default-ssl-socket-fn}})Experimental, subject to change. Feedback welcome! - +Options: + `:format-inst-fn` - (fn format [instant]) => string.tcp-socket-writer
clj
(tcp-socket-writer {:keys [host port ssl? connect-timeout-msecs socket-fn ssl-socket-fn], :as opts, :or {connect-timeout-msecs 3000, socket-fn default-socket-fn, ssl-socket-fn default-ssl-socket-fn}})Experimental, subject to change. Connects to specified TCP socket and returns a stateful fn of 2 arities: [content] => Writes given content to socket, or no-ops if closed. [] => Closes the writer.