diff --git a/index.clj.html b/index.clj.html index 50f1906..9529ec2 100644 --- a/index.clj.html +++ b/index.clj.html @@ -1,6 +1,6 @@ -Telemere 1.0.0-beta20

Telemere 1.0.0-beta20

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-beta20"]

Namespaces

taoensso.telemere

Structured telemetry for Clojure/Script applications.

taoensso.telemere.open-telemetry

OpenTelemetry handler using `opentelemetry-java`,
+Telemere 1.0.0-beta21

Telemere 1.0.0-beta21

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-beta21"]

Namespaces

taoensso.telemere.postal

Email handler using `postal`,
 Ref. <https://github.com/drewr/postal>.

Public variables and functions:

taoensso.telemere.slack

Slack handler using `clj-slack`,
diff --git a/index.cljs.html b/index.cljs.html
index 68f4d8c..af50b30 100644
--- a/index.cljs.html
+++ b/index.cljs.html
@@ -1,4 +1,4 @@
 
-Telemere 1.0.0-beta20

Telemere 1.0.0-beta20

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-beta20"]

Namespaces

taoensso.telemere.timbre

Main Timbre macros, reimplemented on top of Telemere.
+Telemere 1.0.0-beta21

Telemere 1.0.0-beta21

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-beta21"]

Namespaces

taoensso.telemere.timbre

Main Timbre macros, reimplemented on top of Telemere.
 Intended to help ease migration from Timbre to Telemere.

Public variables and functions:

\ No newline at end of file diff --git a/index.html b/index.html index bd57d51..21b794b 100644 --- a/index.html +++ b/index.html @@ -1,3 +1,3 @@ -Telemere 1.0.0-beta20

Telemere 1.0.0-beta20

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-beta20"]

Platforms

This project includes code for multiple platforms, please choose a platform to view its documentation:

\ No newline at end of file +Telemere 1.0.0-beta21

Telemere 1.0.0-beta21

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-beta21"]

Platforms

This project includes code for multiple platforms, please choose a platform to view its documentation:

\ No newline at end of file diff --git a/taoensso.telemere.cljs.html b/taoensso.telemere.cljs.html index 14da6da..1802564 100644 --- a/taoensso.telemere.cljs.html +++ b/taoensso.telemere.cljs.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

Optional context (state) attached to all signals.
@@ -29,6 +29,18 @@ Modify  root (default) value using `set-middleware!`.
 As with all dynamic Clojure vars, "binding conveyance" applies when using
 futures, agents, etc.
 
+Examples:
+
+  ;; Filter signals by returning nil:
+  (t/set-middleware! (fn [signal] (when-not (:skip-me? signal) signal)))
+
+  ;; Remove key/s from signals:
+  (t/set-middleware! (fn [signal] (dissoc signal :unwanted-key1 ...)))
+
+  ;; Remove key/s from signals to specific handler:
+  (t/add-handler! ::my-handler my-handler
+    {:middleware (fn [signal] (dissoc signal :unwanted-key1 ...))})
+
 Tips:
   - Compose multiple middleware fns together with `comp-middleware`.
   - Use `get-env` to set default (root) value based on environmental config.

*uid-fn*

dynamic

clj

cljs

Experimental, subject to change.
@@ -196,10 +208,14 @@ Returns a (fn format [signal]) that:
 
 Options:
   `:incl-newline?` - Include terminating system newline? (default true)
-  `:preamble-fn`   - (fn [signal]) => signal preamble string.
-  `:content-fn`    - (fn [signal]) => signal content  string.
+  `:preamble-fn`   - (fn [signal]) => signal preamble string, see [1].
+  `:content-fn`    - (fn [signal]) => signal content  string, see [2].
 
-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 an environmental config value
+[1] `taoensso.telemere.utils/signal-preamble-fn`, etc.
+[2] `taoensso.telemere.utils/signal-content-fn`,  etc.
+
+See also `pr-signal-fn` for an alternative to `format-signal-fn`
+that produces machine-readable output (edn, JSON, etc.).

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 an environmental config value
 during macro expansion. Used by other Taoensso libraries.
 
 Given a const kw/string id or vector of desc-priority alternative ids,
@@ -316,8 +332,10 @@ Intended for use with browser formatting tools like `binaryage/devtools`,
 Ref. <https://github.com/binaryage/cljs-devtools>.
 
 Options:
-  `:preamble-fn`     - (fn [signal])   => string.
-  `:format-nsecs-fn` - (fn [nanosecs]) => string.

help:environmental-config

clj

cljs

Telemere supports extensive environmental config via JVM properties,
+  `:preamble-fn`     - (fn [signal])   => string, see [1].
+  `:format-nsecs-fn` - (fn [nanosecs]) => string.
+
+[1] `taoensso.telemere.utils/signal-preamble-fn`, etc.

help:environmental-config

clj

cljs

Telemere supports extensive environmental config via JVM properties,
 environment variables, or classpath resources.
 
 Environmental filter config includes:
@@ -387,7 +405,7 @@ Tips:
   4. Handler middleware (fn [signal]) => ?modified-signal does not return nil
 
 Note that middleware provides a flexible way to filter signals by arbitrary
-signal data/content conditions (return nil to suppress signal).
+signal data/content conditions (return nil to filter signal).
 
 Config:
 
@@ -406,8 +424,8 @@ Config:
     See `help:handler-dispatch-options` for details.
 
     Note: signal filters (1a, 1b) should generally be AT LEAST as permissive as
-    handler filters (2b), otherwise signals will be suppressed before reaching
-    handlers.
+    handler filters (2b), otherwise signals will be filtered before even
+    reaching handlers.
 
   To set signal middleware (3): use `set-middleware!`, `with-middleware`
 
@@ -691,7 +709,7 @@ Useful for conditionally splicing in extra message content, etc.:
 

pr-signal-fn

clj

cljs

(pr-signal-fn)(pr-signal-fn {:keys [pr-fn incl-kvs? incl-nils? incl-newline? incl-keys], :as opts, :or {pr-fn :edn, incl-newline? true}})
Experimental, subject to change.
 Returns a (fn pr [signal]) that:
   - Takes a Telemere signal (map).
-  - Returns a machine-readable signal ?string.
+  - Returns a machine-readable signal string.
 
 Options:
   `:pr-fn`         - ∈ #{<unary-fn> :edn (default) :json (Cljs only)}
@@ -702,14 +720,17 @@ Options:
                      excluded by default: #{:location :kvs :file :host :thread}
 
 Examples:
-  (pr-signal-fn {:pr-fn :edn  ...}) ; Outputs edn
-  (pr-signal-fn {:pr-fn :json ...}) ; Outputs JSON (Cljs only)
 
-  To output JSON for Clj, you must provide an appropriate `:pr-fn`.
-  `jsonista` offers one good option, Ref. <https://github.com/metosin/jsonista>:
+  ;; To print as edn:
+  (pr-signal-fn {:pr-fn :edn})
 
-    (require '[jsonista.core :as jsonista])
-    (pr-signal-fn {:pr-fn jsonista/write-value-as-string ...})
+  ;; To print as JSON:
+  ;; Ref.  <https://github.com/metosin/jsonista> (or any alt JSON lib)
+  #?(:clj (require '[jsonista.core :as jsonista]))
+  (pr-signal-fn
+    {:pr-fn
+      #?(:cljs :json ; Use js/JSON.stringify
+         :clj  jsonista/write-value-as-string)})
 
 Motivation:
   Why use this util instead of just directly using the print function
@@ -719,7 +740,8 @@ Motivation:
   This util efficiently clean signals of such noise, helping reduce
   storage/transmission size, and making key info easier to see.
 
-See also `format-signal-fn` for human-readable output.

rate-limiter

clj

cljs

(rate-limiter spec)(rate-limiter opts spec)
Takes a spec of form
+See also `format-signal-fn` for an alternative to `pr-signal-fn`
+that produces human-readable output.

rate-limiter

clj

cljs

(rate-limiter spec)(rate-limiter opts spec)
Takes a spec of form
   [           [<n-max-reqs> <msecs-window>] ...] or
   {<limit-id> [<n-max-reqs> <msecs-window>]},
 and returns a basic stateful (fn a-rate-limiter [req-id] [command req-id]).
diff --git a/taoensso.telemere.html b/taoensso.telemere.html
index 2ecdc8b..90e6166 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

Optional context (state) attached to all signals.
@@ -29,6 +29,18 @@ Modify  root (default) value using `set-middleware!`.
 As with all dynamic Clojure vars, "binding conveyance" applies when using
 futures, agents, etc.
 
+Examples:
+
+  ;; Filter signals by returning nil:
+  (t/set-middleware! (fn [signal] (when-not (:skip-me? signal) signal)))
+
+  ;; Remove key/s from signals:
+  (t/set-middleware! (fn [signal] (dissoc signal :unwanted-key1 ...)))
+
+  ;; Remove key/s from signals to specific handler:
+  (t/add-handler! ::my-handler my-handler
+    {:middleware (fn [signal] (dissoc signal :unwanted-key1 ...))})
+
 Tips:
   - Compose multiple middleware fns together with `comp-middleware`.
   - Use `get-env` to set default (root) value based on environmental config.

*otel-tracer*

dynamic

clj

*uid-fn*

dynamic

clj

cljs

Experimental, subject to change.
@@ -184,10 +196,14 @@ Returns a (fn format [signal]) that:
 
 Options:
   `:incl-newline?` - Include terminating system newline? (default true)
-  `:preamble-fn`   - (fn [signal]) => signal preamble string.
-  `:content-fn`    - (fn [signal]) => signal content  string.
+  `:preamble-fn`   - (fn [signal]) => signal preamble string, see [1].
+  `:content-fn`    - (fn [signal]) => signal content  string, see [2].
 
-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 an environmental config value
+[1] `taoensso.telemere.utils/signal-preamble-fn`, etc.
+[2] `taoensso.telemere.utils/signal-content-fn`,  etc.
+
+See also `pr-signal-fn` for an alternative to `format-signal-fn`
+that produces machine-readable output (edn, JSON, etc.).

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 an environmental config value
 during macro expansion. Used by other Taoensso libraries.
 
 Given a const kw/string id or vector of desc-priority alternative ids,
@@ -398,7 +414,7 @@ Tips:
   4. Handler middleware (fn [signal]) => ?modified-signal does not return nil
 
 Note that middleware provides a flexible way to filter signals by arbitrary
-signal data/content conditions (return nil to suppress signal).
+signal data/content conditions (return nil to filter signal).
 
 Config:
 
@@ -417,8 +433,8 @@ Config:
     See `help:handler-dispatch-options` for details.
 
     Note: signal filters (1a, 1b) should generally be AT LEAST as permissive as
-    handler filters (2b), otherwise signals will be suppressed before reaching
-    handlers.
+    handler filters (2b), otherwise signals will be filtered before even
+    reaching handlers.
 
   To set signal middleware (3): use `set-middleware!`, `with-middleware`
 
@@ -747,7 +763,7 @@ See also: `otel-get-default-providers`, `*otel-tracer*`,
 [1] Ref. <https://github.com/open-telemetry/opentelemetry-java>

pr-signal-fn

clj

cljs

(pr-signal-fn)(pr-signal-fn {:keys [pr-fn incl-kvs? incl-nils? incl-newline? incl-keys], :as opts, :or {pr-fn :edn, incl-newline? true}})
Experimental, subject to change.
 Returns a (fn pr [signal]) that:
   - Takes a Telemere signal (map).
-  - Returns a machine-readable signal ?string.
+  - Returns a machine-readable signal string.
 
 Options:
   `:pr-fn`         - ∈ #{<unary-fn> :edn (default) :json (Cljs only)}
@@ -758,14 +774,17 @@ Options:
                      excluded by default: #{:location :kvs :file :host :thread}
 
 Examples:
-  (pr-signal-fn {:pr-fn :edn  ...}) ; Outputs edn
-  (pr-signal-fn {:pr-fn :json ...}) ; Outputs JSON (Cljs only)
 
-  To output JSON for Clj, you must provide an appropriate `:pr-fn`.
-  `jsonista` offers one good option, Ref. <https://github.com/metosin/jsonista>:
+  ;; To print as edn:
+  (pr-signal-fn {:pr-fn :edn})
 
-    (require '[jsonista.core :as jsonista])
-    (pr-signal-fn {:pr-fn jsonista/write-value-as-string ...})
+  ;; To print as JSON:
+  ;; Ref.  <https://github.com/metosin/jsonista> (or any alt JSON lib)
+  #?(:clj (require '[jsonista.core :as jsonista]))
+  (pr-signal-fn
+    {:pr-fn
+      #?(:cljs :json ; Use js/JSON.stringify
+         :clj  jsonista/write-value-as-string)})
 
 Motivation:
   Why use this util instead of just directly using the print function
@@ -775,7 +794,8 @@ Motivation:
   This util efficiently clean signals of such noise, helping reduce
   storage/transmission size, and making key info easier to see.
 
-See also `format-signal-fn` for human-readable output.

rate-limiter

clj

cljs

(rate-limiter spec)(rate-limiter opts spec)
Takes a spec of form
+See also `format-signal-fn` for an alternative to `pr-signal-fn`
+that produces human-readable output.

rate-limiter

clj

cljs

(rate-limiter spec)(rate-limiter opts spec)
Takes a spec of form
   [           [<n-max-reqs> <msecs-window>] ...] or
   {<limit-id> [<n-max-reqs> <msecs-window>]},
 and returns a basic stateful (fn a-rate-limiter [req-id] [command req-id]).
diff --git a/taoensso.telemere.open-telemetry.html b/taoensso.telemere.open-telemetry.html
index b9c9e5b..4104418 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

check-interop

clj

(check-interop)
Returns interop debug info map.
 

handler:open-telemetry

clj

(handler:open-telemetry)(handler:open-telemetry {:keys [emit-tracing? logger-provider], :or {emit-tracing? true}})
Highly experimental, possibly buggy, and subject to change!!
diff --git a/taoensso.telemere.postal.html b/taoensso.telemere.postal.html
index a3abd40..654663e 100644
--- a/taoensso.telemere.postal.html
+++ b/taoensso.telemere.postal.html
@@ -1,6 +1,6 @@
 
-taoensso.telemere.postal documentation

taoensso.telemere.postal

Email handler using `postal`,
+taoensso.telemere.postal documentation

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>.
diff --git a/taoensso.telemere.slack.html b/taoensso.telemere.slack.html
index e1ecd3e..c303d1f 100644
--- a/taoensso.telemere.slack.html
+++ b/taoensso.telemere.slack.html
@@ -1,6 +1,6 @@
 
-taoensso.telemere.slack documentation

taoensso.telemere.slack

Slack handler using `clj-slack`,
+taoensso.telemere.slack documentation

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>.
diff --git a/taoensso.telemere.sockets.html b/taoensso.telemere.sockets.html
index 9270716..1e7b5bd 100644
--- a/taoensso.telemere.sockets.html
+++ b/taoensso.telemere.sockets.html
@@ -1,6 +1,6 @@
 
-taoensso.telemere.sockets documentation

taoensso.telemere.sockets

Basic TCP/UDP socket handlers.
+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 signal handler that:
diff --git a/taoensso.telemere.streams.html b/taoensso.telemere.streams.html
index 180c4a7..872dd67 100644
--- a/taoensso.telemere.streams.html
+++ b/taoensso.telemere.streams.html
@@ -1,6 +1,6 @@
 
-taoensso.telemere.streams documentation

taoensso.telemere.streams

Interop support for standard stream/s -> Telemere.
+taoensso.telemere.streams documentation

taoensso.telemere.streams

Interop support for standard stream/s -> Telemere.
 

check-err-interop

clj

(check-err-interop)
Returns interop debug info map.
 

check-out-interop

clj

(check-out-interop)
Returns interop debug info map.
 

streams->reset!

clj

(streams->reset!)
Experimental, subject to change.
diff --git a/taoensso.telemere.timbre.cljs.html b/taoensso.telemere.timbre.cljs.html
index cd262e0..32d497f 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

taoensso.telemere.timbre

Main Timbre macros, reimplemented on top of Telemere.
 Intended to help ease migration from Timbre to Telemere.

set-min-level!

clj

cljs

(set-min-level! min-level)
Prefer `telemere/set-min-level!`.
 

shutdown-appenders!

clj

cljs

(shutdown-appenders!)
Prefer `telemere/stop-handlers!`.
 
\ No newline at end of file diff --git a/taoensso.telemere.timbre.html b/taoensso.telemere.timbre.html index 150764d..0eddd14 100644 --- a/taoensso.telemere.timbre.html +++ b/taoensso.telemere.timbre.html @@ -1,6 +1,6 @@ -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 e2744e2..b5fb59c 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

Interop support for `tools.logging` -> Telemere.
+taoensso.telemere.tools-logging documentation

taoensso.telemere.tools-logging

Interop support for `tools.logging` -> Telemere.
 Telemere will attempt to load this ns automatically when possible.
 
 Naming conventions:
diff --git a/taoensso.telemere.utils.cljs.html b/taoensso.telemere.utils.cljs.html
index 77a1296..fb2152d 100644
--- a/taoensso.telemere.utils.cljs.html
+++ b/taoensso.telemere.utils.cljs.html
@@ -1,6 +1,6 @@
 
-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-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.

format-error-fn

clj

cljs

(format-error-fn)(format-error-fn {:as _opts})
Experimental, subject to change.
@@ -30,10 +30,14 @@ Returns a (fn format [signal]) that:
 
 Options:
   `:incl-newline?` - Include terminating system newline? (default true)
-  `:preamble-fn`   - (fn [signal]) => signal preamble string.
-  `:content-fn`    - (fn [signal]) => signal content  string.
+  `:preamble-fn`   - (fn [signal]) => signal preamble string, see [1].
+  `:content-fn`    - (fn [signal]) => signal content  string, see [2].
 
-See also `pr-signal-fn` for machine-readable output.

hex-uid-fn

clj

cljs

(hex-uid-fn)(hex-uid-fn {:keys [secure? root-len child-len], :or {root-len 32, child-len 16}})
Experimental, subject to change.
+[1] `taoensso.telemere.utils/signal-preamble-fn`, etc.
+[2] `taoensso.telemere.utils/signal-content-fn`,  etc.
+
+See also `pr-signal-fn` for an alternative to `format-signal-fn`
+that produces machine-readable output (edn, JSON, etc.).

hex-uid-fn

clj

cljs

(hex-uid-fn)(hex-uid-fn {:keys [secure? root-len child-len], :or {root-len 32, child-len 16}})
Experimental, subject to change.
 Returns a (fn hex-uid [root?]) that returns a random hex-style uid string like:
   "05039666eb9dc3206475f44ab9f3d843" - 128 bit (32 char)     root         uid
   "721fcef639a51513"                 - 64  bit (16 char) non-root (child) uid

js-console-logger

cljs

(js-console-logger level)
Returns JavaScript console logger to match given signal level:
@@ -50,7 +54,7 @@ Returns a (fn nano-uid [root?]) that returns a random nano-style uid string like
 

pr-signal-fn

clj

cljs

(pr-signal-fn)(pr-signal-fn {:keys [pr-fn incl-kvs? incl-nils? incl-newline? incl-keys], :as opts, :or {pr-fn :edn, incl-newline? true}})
Experimental, subject to change.
 Returns a (fn pr [signal]) that:
   - Takes a Telemere signal (map).
-  - Returns a machine-readable signal ?string.
+  - Returns a machine-readable signal string.
 
 Options:
   `:pr-fn`         - ∈ #{<unary-fn> :edn (default) :json (Cljs only)}
@@ -61,14 +65,17 @@ Options:
                      excluded by default: #{:location :kvs :file :host :thread}
 
 Examples:
-  (pr-signal-fn {:pr-fn :edn  ...}) ; Outputs edn
-  (pr-signal-fn {:pr-fn :json ...}) ; Outputs JSON (Cljs only)
 
-  To output JSON for Clj, you must provide an appropriate `:pr-fn`.
-  `jsonista` offers one good option, Ref. <https://github.com/metosin/jsonista>:
+  ;; To print as edn:
+  (pr-signal-fn {:pr-fn :edn})
 
-    (require '[jsonista.core :as jsonista])
-    (pr-signal-fn {:pr-fn jsonista/write-value-as-string ...})
+  ;; To print as JSON:
+  ;; Ref.  <https://github.com/metosin/jsonista> (or any alt JSON lib)
+  #?(:clj (require '[jsonista.core :as jsonista]))
+  (pr-signal-fn
+    {:pr-fn
+      #?(:cljs :json ; Use js/JSON.stringify
+         :clj  jsonista/write-value-as-string)})
 
 Motivation:
   Why use this util instead of just directly using the print function
@@ -78,7 +85,8 @@ Motivation:
   This util efficiently clean signals of such noise, helping reduce
   storage/transmission size, and making key info easier to see.
 
-See also `format-signal-fn` for human-readable output.

signal-content-fn

clj

cljs

(signal-content-fn)(signal-content-fn {:keys [raw-error? incl-keys format-nsecs-fn format-error-fn], :or {format-nsecs-fn (format-nsecs-fn), format-error-fn (format-error-fn)}})
Experimental, subject to change.
+See also `format-signal-fn` for an alternative to `pr-signal-fn`
+that produces human-readable output.

signal-content-fn

clj

cljs

(signal-content-fn)(signal-content-fn {:keys [raw-error? incl-keys 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 (map).
   - Returns a signal content ?string (incl. data, ctx, etc.).
diff --git a/taoensso.telemere.utils.html b/taoensso.telemere.utils.html
index 79086c7..2434cfc 100644
--- a/taoensso.telemere.utils.html
+++ b/taoensso.telemere.utils.html
@@ -1,6 +1,6 @@
 
-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-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 {:keys [file append?], :or {append? true}})
Experimental, subject to change.
@@ -41,10 +41,14 @@ Returns a (fn format [signal]) that:
 
 Options:
   `:incl-newline?` - Include terminating system newline? (default true)
-  `:preamble-fn`   - (fn [signal]) => signal preamble string.
-  `:content-fn`    - (fn [signal]) => signal content  string.
+  `:preamble-fn`   - (fn [signal]) => signal preamble string, see [1].
+  `:content-fn`    - (fn [signal]) => signal content  string, see [2].
 
-See also `pr-signal-fn` for machine-readable output.

hex-uid-fn

clj

cljs

(hex-uid-fn)(hex-uid-fn {:keys [secure? root-len child-len], :or {root-len 32, child-len 16}})
Experimental, subject to change.
+[1] `taoensso.telemere.utils/signal-preamble-fn`, etc.
+[2] `taoensso.telemere.utils/signal-content-fn`,  etc.
+
+See also `pr-signal-fn` for an alternative to `format-signal-fn`
+that produces machine-readable output (edn, JSON, etc.).

hex-uid-fn

clj

cljs

(hex-uid-fn)(hex-uid-fn {:keys [secure? root-len child-len], :or {root-len 32, child-len 16}})
Experimental, subject to change.
 Returns a (fn hex-uid [root?]) that returns a random hex-style uid string like:
   "05039666eb9dc3206475f44ab9f3d843" - 128 bit (32 char)     root         uid
   "721fcef639a51513"                 - 64  bit (16 char) non-root (child) uid

host-info

clj

added in Encore v3.115.0 (2024-08-18)

(host-info)(host-info cache-msecs timeout-msecs fallback-val)(host-info fallback-val)(host-info timeout-msecs fallback-val)
Returns ?{:keys [ip name]} with string vals or `fallback-val` (default nil).
@@ -61,7 +65,7 @@ Returns a (fn nano-uid [root?]) that returns a random nano-style uid string like
 

pr-signal-fn

clj

cljs

(pr-signal-fn)(pr-signal-fn {:keys [pr-fn incl-kvs? incl-nils? incl-newline? incl-keys], :as opts, :or {pr-fn :edn, incl-newline? true}})
Experimental, subject to change.
 Returns a (fn pr [signal]) that:
   - Takes a Telemere signal (map).
-  - Returns a machine-readable signal ?string.
+  - Returns a machine-readable signal string.
 
 Options:
   `:pr-fn`         - ∈ #{<unary-fn> :edn (default) :json (Cljs only)}
@@ -72,14 +76,17 @@ Options:
                      excluded by default: #{:location :kvs :file :host :thread}
 
 Examples:
-  (pr-signal-fn {:pr-fn :edn  ...}) ; Outputs edn
-  (pr-signal-fn {:pr-fn :json ...}) ; Outputs JSON (Cljs only)
 
-  To output JSON for Clj, you must provide an appropriate `:pr-fn`.
-  `jsonista` offers one good option, Ref. <https://github.com/metosin/jsonista>:
+  ;; To print as edn:
+  (pr-signal-fn {:pr-fn :edn})
 
-    (require '[jsonista.core :as jsonista])
-    (pr-signal-fn {:pr-fn jsonista/write-value-as-string ...})
+  ;; To print as JSON:
+  ;; Ref.  <https://github.com/metosin/jsonista> (or any alt JSON lib)
+  #?(:clj (require '[jsonista.core :as jsonista]))
+  (pr-signal-fn
+    {:pr-fn
+      #?(:cljs :json ; Use js/JSON.stringify
+         :clj  jsonista/write-value-as-string)})
 
 Motivation:
   Why use this util instead of just directly using the print function
@@ -89,7 +96,8 @@ Motivation:
   This util efficiently clean signals of such noise, helping reduce
   storage/transmission size, and making key info easier to see.
 
-See also `format-signal-fn` for human-readable output.

signal-content-fn

clj

cljs

(signal-content-fn)(signal-content-fn {:keys [raw-error? incl-keys format-nsecs-fn format-error-fn], :or {format-nsecs-fn (format-nsecs-fn), format-error-fn (format-error-fn)}})
Experimental, subject to change.
+See also `format-signal-fn` for an alternative to `pr-signal-fn`
+that produces human-readable output.

signal-content-fn

clj

cljs

(signal-content-fn)(signal-content-fn {:keys [raw-error? incl-keys 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 (map).
   - Returns a signal content ?string (incl. data, ctx, etc.).