diff --git a/index.clj.html b/index.clj.html index cdba8af..f96d329 100644 --- a/index.clj.html +++ b/index.clj.html @@ -1,5 +1,7 @@ -Telemere 1.0.0-beta3

Telemere 1.0.0-beta3

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

Namespaces

taoensso.telemere

Structured telemetry for Clojure/Script applications.

taoensso.telemere.open-telemetry

Core OpenTelemetry handler and utils.

taoensso.telemere.streams

Intake support for standard stream/s -> Telemere.

taoensso.telemere.timbre

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

Telemere 1.0.0-beta4

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

Namespaces

taoensso.telemere.postal

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

taoensso.telemere.tools-logging

Intake support for `clojure.tools.logging` -> Telemere.
-Telemere will attempt to load this ns automatically when possible.
\ No newline at end of file +Telemere will attempt to load this ns automatically when possible.

taoensso.telemere.utils

Misc utils useful for Telemere handlers, middleware, etc.
\ No newline at end of file diff --git a/index.cljs.html b/index.cljs.html index 047e6cc..dd57323 100644 --- a/index.cljs.html +++ b/index.cljs.html @@ -1,4 +1,4 @@ -Telemere 1.0.0-beta3

Telemere 1.0.0-beta3

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

Namespaces

taoensso.telemere

Structured telemetry for Clojure/Script applications.

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.
\ No newline at end of file +Telemere 1.0.0-beta4

Telemere 1.0.0-beta4

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

Namespaces

taoensso.telemere

Structured telemetry for Clojure/Script applications.

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.
\ No newline at end of file diff --git a/index.html b/index.html index f2c6a5c..1cdb3b9 100644 --- a/index.html +++ b/index.html @@ -1,3 +1,3 @@ -Telemere 1.0.0-beta3

Telemere 1.0.0-beta3

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

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-beta4

Telemere 1.0.0-beta4

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

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 3578b37..54bdc49 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

Dynamic context: arbitrary user-level state attached as `:ctx` to all signals.
@@ -53,6 +53,9 @@ Dispatch options include:
      Default:
        {:mode :dropping, :buffer-size 1024, :n-threads 1, :daemon-threads? true}
 
+       I.e. async by default, with a buffer of size 1024 that drops new entries
+       when full.
+
      Options:
        `mode`        - Mode of operation, ∈ #{:sync :blocking :dropping :sliding}.
        `buffer-size` - Size of buffer before back-pressure mechanism is engaged.
@@ -225,14 +228,14 @@ Tips:
 [1] See `help:signal-creators` - (`signal!`, `log!`, `event!`, ...)
 [2] See `help:signal-options`  - {:keys [kind level id data ...]}
 [3] See `help:signal-content`  - {:keys [kind level id data ...]}
-[4] See `help:signal-flow`     - (filters, handling, etc.)

get-env

macro

clj

cljs

added in Encore v3.75.0 (2024-01-29)

(get-env {:keys [as default return]} spec)(get-env {:keys [as default return spec], :or {as :str, return :value}})
Cross-platform util for embedding flexible environmental config during
+[4] See `help:signal-flow`     - (filters, handling, 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 a config value during
 macro expansion. Used by other Taoensso libraries.
 
 Given a const kw/string id or vector of desc-priority alternative ids,
 parse and return the first of the following that exists:
-  - JVM         property value   for id ("prop")
-  - Environment variable value   for id ("env")
-  - Classpath   resource content for id ("res")
+  - JVM         property value   for id
+  - Environment variable value   for id
+  - Classpath   resource content for id
 
 Ids may include optional segment in `<>` tag (e.g. `<.edn>`).
 Ids may include `<.?platform.?>` tag for auto replacement, useful
@@ -240,25 +243,25 @@ for supporting platform-specific config.
 
 Search order: desc by combined [alt-index platform(y/n) optional(y/n)].
 
-(get-env {:as :edn} [:my-app/alt1<.platform><.edn> :my-app/alt2])
+So (get-env {:as :edn} [:my-app/alt1<.platform><.edn> :my-app/alt2])
 will parse and return the first of the following that exists:
 
-  1. Alt1 +platform +optional (content type)
+  1. Alt1 +platform +optional (.edn suffix)
     1a. `my-app.alt1.clj.edn` JVM         property value
     1b. `MY_APP_ALT1_CLJ_EDN` environment variable value
     1c. `my-app.alt1.clj.edn` classpath   resource content
 
-  2. Alt1 +platform -optional (content type)
+  2. Alt1 +platform -optional (.edn suffix)
     2a. `my-app.alt1.clj`     JVM         property value
     2b. `MY_APP_ALT1_CLJ`     environment variable value
     2c. `my-app.alt1.clj`     classpath   resource content
 
-  3. Alt1 -platform +optional (content type)
+  3. Alt1 -platform +optional (.edn suffix)
     3a. `my-app.alt1.edn`     JVM         property value
     3b. `MY_APP_ALT1_EDN`     environment variable value
     3c. `my-app.alt1.edn`     classpath   resource content
 
-  4. Alt1 -platform -optional (content type)
+  4. Alt1 -platform -optional (.edn suffix)
     4a. `my-app.alt1`         JVM         property value
     4b. `MY_APP_ALT1`         environment variable value
     4c. `my-app.alt1`         classpath   resource content
@@ -269,23 +272,28 @@ will parse and return the first of the following that exists:
     5c. `my-app.alt2`         classpath   resource content
 
 Options:
-  `:as`      - Parse found value as given type ∈ #{:str :bool :edn} (default :str).
-  `:default` - Fallback to return if no value found during search (default nil).
-  `:return`  - Return type ∈ #{:value :map :debug} (default :value).
-               TIP: Use `:debug` to inspect/verify search behaviour!
+  `:as`      - Parse found value as given type ∈ #{:str :bool :edn} (default `:str`).
+  `:default` - Fallback to return unparsed if no value found during search (default `nil`).
+  `:return`  - Return type ∈ #{:value :map :explain} (default `:value`).
 
-Result must be something that can be safely embedded in code during
-macro-expansion. Symbols in edn will be evaluated during expansion.

get-filters

clj

cljs

(get-filters)
Returns current ?{:keys [compile-time runtime]} filter config.
+Resulting config value must be something that can be safely embedded in code during
+macro-expansion. Symbols in edn will be evaluated during expansion.
+
+TIP!: Use the {:return :explain} option in tests or at the REPL to verify/inspect
+resulting config value, config source, and specific search order of prop/env/res ids.

get-filters

clj

cljs

(get-filters)
Returns current ?{:keys [compile-time runtime]} filter config.
 

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 [format-signal-fn], :or {format-signal-fn (utils/format-signal->str-fn)}})
Experimental, subject to change.
+

handler:console

clj

cljs

(handler:console)(handler:console {:keys [format-signal-fn], :or {format-signal-fn (utils/format-signal->str-fn)}})
Experimental, subject to change. Feedback welcome!
 
 If `js/console` exists, returns a (fn handler [signal]) that:
   - Takes a Telemere signal.
   - Writes a formatted signal 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.
+
 Options:
-  `:format-signal-fn` - (fn [signal]) => output, see `help:signal-formatters`

handler:console-raw

cljs

(handler:console-raw)(handler:console-raw {:keys [format-signal-prelude-fn format-nsecs-fn], :as opts, :or {format-signal-prelude-fn (utils/format-signal-prelude-fn), format-nsecs-fn (utils/format-nsecs-fn)}})
Experimental, subject to change.
+  `:format-signal-fn` - (fn [signal]) => output, see `help:signal-formatters`

handler:console-raw

cljs

(handler:console-raw)(handler:console-raw {:keys [format-signal->prelude-fn format-nsecs-fn], :as opts, :or {format-signal->prelude-fn (utils/format-signal->prelude-fn), format-nsecs-fn (utils/format-nsecs-fn)}})
Experimental, subject to change. Feedback welcome!
 
 If `js/console` exists, returns a (fn handler [signal]) that:
   - Takes a Telemere signal.
@@ -294,11 +302,13 @@ If `js/console` exists, returns a (fn handler [signal]) that:
 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.
 
-Filtering can occur at compile-time (=> elision), or runtime.
-Both compile-time and runtime config can be specified with:
+Filtering can occur at compile-time, runtime, or both.
+Compile-time filtering elides (permanently removes!) code for
+disallowed signals. Most users will want only runtime filtering.
 
-  System values (JVM properties, environment variables, or
-  classpath resources) [1].
+Both compile-time and runtime config can be specified via
+environmental config (JVM properties, environment variables, or
+classpath resources) [1].
 
 Runtime config can also be specified with:
 
@@ -320,21 +330,7 @@ See also:
 If anything is unclear, please ping me (@ptaoussanis) so that I can
 improve these docs!
 
-[1] These include:
-
-  Compile-time:
-
-    ns-filter: (get-env {:as :edn} :taoensso.telemere/ct-ns-filter<.platform><.edn>)
-    id-filter: (get-env {:as :edn} :taoensso.telemere/ct-id-filter<.platform><.edn>)
-    min-level: (get-env {:as :edn} :taoensso.telemere/ct-min-level<.platform><.edn>)
-
-  Runtime:
-
-    ns-filter: (get-env {:as :edn}                 :taoensso.telemere/rt-ns-filter<.platform><.edn>)
-    id-filter: (get-env {:as :edn}                 :taoensso.telemere/rt-id-filter<.platform><.edn>)
-    min-level: (get-env {:as :edn, :default :info} :taoensso.telemere/rt-min-level<.platform><.edn>)
-
-  See `get-env` for details.

help:handlers

clj

cljs

Manage handlers with:
+[1] (impl/signal-docstring :filter-env-config)

help:handlers

clj

cljs

Manage handlers with:
 
   `get-handlers`        - Returns info on registered handlers
   `shut-down-handlers!` - Shuts down      registered handlers
@@ -376,7 +372,9 @@ Default signal keys:
 `:file` -------- ?str filename  of signal creator callsite, same as (:file   location)
 `:sample-rate` - ?rate ∈ℝ[0,1] for combined signal AND handler sampling (0.75 => allow 75% of signals, nil => allow all)
 
-<kvs> ---------- Arb other user-level ?kvs given to signal creator
+<kvs> ---------- Other arb user-level ?kvs given to signal creator. Typically NOT included
+                 in handler output, so a great way to provide custom data/opts for use
+                 (only) by custom middleware/handlers.
 
 If anything is unclear, please ping me (@ptaoussanis) so that I can improve these docs!
 
@@ -413,6 +411,7 @@ and return values), making them more/less convenient for certain use cases:
 [2] See `help:signal-options` - {:keys [kind level id data ...]}
 [3] See `help:signal-content` - {:keys [kind level id data ...]}
 [4] See `help:signal-flow`    - (filters, handling, etc.)

help:signal-filters

clj

cljs

help:signal-flow

clj

cljs

A signal will be provided to a handler iff ALL of the following are true:
+
   1. Signal (creation) is allowed by compile-time filters
   2. Signal (creation) is allowed by runtime      filters
   3. Signal (handling) is allowed by handler      filters
@@ -421,18 +420,40 @@ and return values), making them more/less convenient for certain use cases:
   5. Handler middleware does not suppress the signal (return nil)
 
 For 1-3, filtering may depend on (in order):
+
   Sample rate → namespace → kind → id → level → when form/fn → rate limit
 
-Note that sample rates are multiplicative:
-  If a signal is created with 20% sampling and a handler handles 50%
-  of given signals, then 10% of possible signals will be handled.
+Compile-time vs runtime filtering:
 
-  This multiplicative rate is helpfully reflected in each signal's final
+  Compile-time filtering is an advanced feature that can be tricky to set
+  and use correctly. Most folks will want ONLY runtime filtering.
+
+  Compile-time filtering works by eliding (completely removing the code for)
+  disallowed signals. This means zero performance cost for these signals,
+  but also means that compile-time filtering is PERMANENT once applied.
+
+  So if you set `:info` as the compile-time minimum level, that'll REMOVE
+  CODE for every signal call below `:info` level. To decrease that minimum
+  level, you'll need to rebuild.
+
+  Compile-time filtering can be set ONLY with environmental config
+  (JVM properties, environment variables, or classpath resources).
+
+Signal and handler sampling is multiplicative:
+
+  Both signals and handlers can have independent sample rates, and these
+  MULTIPLY!
+
+  If a signal is created with 20% sampling and a handler handles 50%
+  of received signals, then 10% of possible signals will be handled
+  (50% of 20%).
+
+  The multiplicative rate is helpfully reflected in each signal's final
   `:sample-rate` value.
 
-For a visual flowchart, see: Ref. <https://www.taoensso.com/telemere/flow>
-
 For more info:
+
+  - Signal visual flowchart, Ref. <https://www.taoensso.com/telemere/flow>
   - On signal  filters, see: `help:signal-filters`  docstring
   - On handler filters, see: `help:signal-handlers` docstring
 
@@ -462,14 +483,18 @@ See relevant docstrings for details.
-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.
@@ -53,6 +53,9 @@ Dispatch options include:
      Default:
        {:mode :dropping, :buffer-size 1024, :n-threads 1, :daemon-threads? true}
 
+       I.e. async by default, with a buffer of size 1024 that drops new entries
+       when full.
+
      Options:
        `mode`        - Mode of operation, ∈ #{:sync :blocking :dropping :sliding}.
        `buffer-size` - Size of buffer before back-pressure mechanism is engaged.
@@ -229,14 +232,14 @@ Tips:
 [1] See `help:signal-creators` - (`signal!`, `log!`, `event!`, ...)
 [2] See `help:signal-options`  - {:keys [kind level id data ...]}
 [3] See `help:signal-content`  - {:keys [kind level id data ...]}
-[4] See `help:signal-flow`     - (filters, handling, etc.)

get-env

macro

clj

cljs

added in Encore v3.75.0 (2024-01-29)

(get-env {:keys [as default return]} spec)(get-env {:keys [as default return spec], :or {as :str, return :value}})
Cross-platform util for embedding flexible environmental config during
+[4] See `help:signal-flow`     - (filters, handling, 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 a config value during
 macro expansion. Used by other Taoensso libraries.
 
 Given a const kw/string id or vector of desc-priority alternative ids,
 parse and return the first of the following that exists:
-  - JVM         property value   for id ("prop")
-  - Environment variable value   for id ("env")
-  - Classpath   resource content for id ("res")
+  - JVM         property value   for id
+  - Environment variable value   for id
+  - Classpath   resource content for id
 
 Ids may include optional segment in `<>` tag (e.g. `<.edn>`).
 Ids may include `<.?platform.?>` tag for auto replacement, useful
@@ -244,25 +247,25 @@ for supporting platform-specific config.
 
 Search order: desc by combined [alt-index platform(y/n) optional(y/n)].
 
-(get-env {:as :edn} [:my-app/alt1<.platform><.edn> :my-app/alt2])
+So (get-env {:as :edn} [:my-app/alt1<.platform><.edn> :my-app/alt2])
 will parse and return the first of the following that exists:
 
-  1. Alt1 +platform +optional (content type)
+  1. Alt1 +platform +optional (.edn suffix)
     1a. `my-app.alt1.clj.edn` JVM         property value
     1b. `MY_APP_ALT1_CLJ_EDN` environment variable value
     1c. `my-app.alt1.clj.edn` classpath   resource content
 
-  2. Alt1 +platform -optional (content type)
+  2. Alt1 +platform -optional (.edn suffix)
     2a. `my-app.alt1.clj`     JVM         property value
     2b. `MY_APP_ALT1_CLJ`     environment variable value
     2c. `my-app.alt1.clj`     classpath   resource content
 
-  3. Alt1 -platform +optional (content type)
+  3. Alt1 -platform +optional (.edn suffix)
     3a. `my-app.alt1.edn`     JVM         property value
     3b. `MY_APP_ALT1_EDN`     environment variable value
     3c. `my-app.alt1.edn`     classpath   resource content
 
-  4. Alt1 -platform -optional (content type)
+  4. Alt1 -platform -optional (.edn suffix)
     4a. `my-app.alt1`         JVM         property value
     4b. `MY_APP_ALT1`         environment variable value
     4c. `my-app.alt1`         classpath   resource content
@@ -273,26 +276,31 @@ will parse and return the first of the following that exists:
     5c. `my-app.alt2`         classpath   resource content
 
 Options:
-  `:as`      - Parse found value as given type ∈ #{:str :bool :edn} (default :str).
-  `:default` - Fallback to return if no value found during search (default nil).
-  `:return`  - Return type ∈ #{:value :map :debug} (default :value).
-               TIP: Use `:debug` to inspect/verify search behaviour!
+  `:as`      - Parse found value as given type ∈ #{:str :bool :edn} (default `:str`).
+  `:default` - Fallback to return unparsed if no value found during search (default `nil`).
+  `:return`  - Return type ∈ #{:value :map :explain} (default `:value`).
 
-Result must be something that can be safely embedded in code during
-macro-expansion. Symbols in edn will be evaluated during expansion.

get-filters

clj

cljs

(get-filters)
Returns current ?{:keys [compile-time runtime]} filter config.
+Resulting config value must be something that can be safely embedded in code during
+macro-expansion. Symbols in edn will be evaluated during expansion.
+
+TIP!: Use the {:return :explain} option in tests or at the REPL to verify/inspect
+resulting config value, config source, and specific search order of prop/env/res ids.

get-filters

clj

cljs

(get-filters)
Returns current ?{:keys [compile-time runtime]} filter config.
 

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 [format-signal-fn stream], :or {format-signal-fn (utils/format-signal->str-fn)}})
Experimental, subject to change.
+

handler:console

clj

cljs

(handler:console)(handler:console {:keys [format-signal-fn stream], :or {format-signal-fn (utils/format-signal->str-fn)}})
Experimental, subject to change. Feedback welcome!
 
 Returns a (fn handler [signal]) that:
   - Takes a Telemere signal.
   - Writes a formatted signal string to stream.
 
+A general-purpose `println`-style handler that's well suited for outputting
+signals formatted as edn, JSON, or human-readable strings.
+
 Options:
   `:format-signal-fn` - (fn [signal]) => output, see `help:signal-formatters`
 
   `:stream` - `java.io.writer`
-    Defaults to `*err*` if `utils/error-signal?` is true, and `*out*` otherwise.

handler:file

clj

(handler:file)(handler:file {:keys [format-signal-fn path interval max-file-size max-num-parts max-num-intervals gzip-archives?], :or {format-signal-fn (utils/format-signal->str-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.
+    Defaults to `*err*` if `utils/error-signal?` is true, and `*out*` otherwise.

handler:file

clj

(handler:file)(handler:file {:keys [format-signal-fn path interval max-file-size max-num-parts max-num-intervals gzip-archives?], :or {format-signal-fn (utils/format-signal->str-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!
 
    Returns a (fn handler [signal]) that:
      - Takes a Telemere signal.
@@ -324,11 +332,13 @@ Options:
   `:max-num-intervals` ∈ #{nil <pos-int>} (default 6)
     Maximum number of intervals (days/weeks/months) to retain.

help:filters

clj

cljs

Your filter config determines which signal calls will be allowed.
 
-Filtering can occur at compile-time (=> elision), or runtime.
-Both compile-time and runtime config can be specified with:
+Filtering can occur at compile-time, runtime, or both.
+Compile-time filtering elides (permanently removes!) code for
+disallowed signals. Most users will want only runtime filtering.
 
-  System values (JVM properties, environment variables, or
-  classpath resources) [1].
+Both compile-time and runtime config can be specified via
+environmental config (JVM properties, environment variables, or
+classpath resources) [1].
 
 Runtime config can also be specified with:
 
@@ -350,21 +360,7 @@ See also:
 If anything is unclear, please ping me (@ptaoussanis) so that I can
 improve these docs!
 
-[1] These include:
-
-  Compile-time:
-
-    ns-filter: (get-env {:as :edn} :taoensso.telemere/ct-ns-filter<.platform><.edn>)
-    id-filter: (get-env {:as :edn} :taoensso.telemere/ct-id-filter<.platform><.edn>)
-    min-level: (get-env {:as :edn} :taoensso.telemere/ct-min-level<.platform><.edn>)
-
-  Runtime:
-
-    ns-filter: (get-env {:as :edn}                 :taoensso.telemere/rt-ns-filter<.platform><.edn>)
-    id-filter: (get-env {:as :edn}                 :taoensso.telemere/rt-id-filter<.platform><.edn>)
-    min-level: (get-env {:as :edn, :default :info} :taoensso.telemere/rt-min-level<.platform><.edn>)
-
-  See `get-env` for details.

help:handlers

clj

cljs

Manage handlers with:
+[1] (impl/signal-docstring :filter-env-config)

help:handlers

clj

cljs

Manage handlers with:
 
   `get-handlers`        - Returns info on registered handlers
   `shut-down-handlers!` - Shuts down      registered handlers
@@ -406,7 +402,9 @@ Default signal keys:
 `:file` -------- ?str filename  of signal creator callsite, same as (:file   location)
 `:sample-rate` - ?rate ∈ℝ[0,1] for combined signal AND handler sampling (0.75 => allow 75% of signals, nil => allow all)
 
-<kvs> ---------- Arb other user-level ?kvs given to signal creator
+<kvs> ---------- Other arb user-level ?kvs given to signal creator. Typically NOT included
+                 in handler output, so a great way to provide custom data/opts for use
+                 (only) by custom middleware/handlers.
 
 If anything is unclear, please ping me (@ptaoussanis) so that I can improve these docs!
 
@@ -444,11 +442,13 @@ and return values), making them more/less convenient for certain use cases:
 [3] See `help:signal-content` - {:keys [kind level id data ...]}
 [4] See `help:signal-flow`    - (filters, handling, etc.)

help:signal-filters

clj

cljs

Your filter config determines which signal calls will be allowed.
 
-Filtering can occur at compile-time (=> elision), or runtime.
-Both compile-time and runtime config can be specified with:
+Filtering can occur at compile-time, runtime, or both.
+Compile-time filtering elides (permanently removes!) code for
+disallowed signals. Most users will want only runtime filtering.
 
-  System values (JVM properties, environment variables, or
-  classpath resources) [1].
+Both compile-time and runtime config can be specified via
+environmental config (JVM properties, environment variables, or
+classpath resources) [1].
 
 Runtime config can also be specified with:
 
@@ -470,21 +470,8 @@ See also:
 If anything is unclear, please ping me (@ptaoussanis) so that I can
 improve these docs!
 
-[1] These include:
+[1] (impl/signal-docstring :filter-env-config)

help:signal-flow

clj

cljs

A signal will be provided to a handler iff ALL of the following are true:
 
-  Compile-time:
-
-    ns-filter: (get-env {:as :edn} :taoensso.telemere/ct-ns-filter<.platform><.edn>)
-    id-filter: (get-env {:as :edn} :taoensso.telemere/ct-id-filter<.platform><.edn>)
-    min-level: (get-env {:as :edn} :taoensso.telemere/ct-min-level<.platform><.edn>)
-
-  Runtime:
-
-    ns-filter: (get-env {:as :edn}                 :taoensso.telemere/rt-ns-filter<.platform><.edn>)
-    id-filter: (get-env {:as :edn}                 :taoensso.telemere/rt-id-filter<.platform><.edn>)
-    min-level: (get-env {:as :edn, :default :info} :taoensso.telemere/rt-min-level<.platform><.edn>)
-
-  See `get-env` for details.

help:signal-flow

clj

cljs

A signal will be provided to a handler iff ALL of the following are true:
   1. Signal (creation) is allowed by compile-time filters
   2. Signal (creation) is allowed by runtime      filters
   3. Signal (handling) is allowed by handler      filters
@@ -493,18 +480,40 @@ improve these docs!
   5. Handler middleware does not suppress the signal (return nil)
 
 For 1-3, filtering may depend on (in order):
+
   Sample rate → namespace → kind → id → level → when form/fn → rate limit
 
-Note that sample rates are multiplicative:
-  If a signal is created with 20% sampling and a handler handles 50%
-  of given signals, then 10% of possible signals will be handled.
+Compile-time vs runtime filtering:
 
-  This multiplicative rate is helpfully reflected in each signal's final
+  Compile-time filtering is an advanced feature that can be tricky to set
+  and use correctly. Most folks will want ONLY runtime filtering.
+
+  Compile-time filtering works by eliding (completely removing the code for)
+  disallowed signals. This means zero performance cost for these signals,
+  but also means that compile-time filtering is PERMANENT once applied.
+
+  So if you set `:info` as the compile-time minimum level, that'll REMOVE
+  CODE for every signal call below `:info` level. To decrease that minimum
+  level, you'll need to rebuild.
+
+  Compile-time filtering can be set ONLY with environmental config
+  (JVM properties, environment variables, or classpath resources).
+
+Signal and handler sampling is multiplicative:
+
+  Both signals and handlers can have independent sample rates, and these
+  MULTIPLY!
+
+  If a signal is created with 20% sampling and a handler handles 50%
+  of received signals, then 10% of possible signals will be handled
+  (50% of 20%).
+
+  The multiplicative rate is helpfully reflected in each signal's final
   `:sample-rate` value.
 
-For a visual flowchart, see: Ref. <https://www.taoensso.com/telemere/flow>
-
 For more info:
+
+  - Signal visual flowchart, Ref. <https://www.taoensso.com/telemere/flow>
   - On signal  filters, see: `help:signal-filters`  docstring
   - On handler filters, see: `help:signal-handlers` docstring
 
@@ -546,14 +555,18 @@ improve these docs!

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__3686__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__9349__auto__)
Shuts down all registered signal handlers in parallel, and returns
 ?{<handler-id> {:keys [okay error]}}.
 
 Future calls to handlers will no-op.
@@ -757,9 +770,9 @@ Tips:
 [1] See `help:signal-creators` - (`signal!`, `log!`, `event!`, ...)
 [2] See `help:signal-options`  - {:keys [kind level id data ...]}
 [3] See `help:signal-content`  - {:keys [kind level id data ...]}
-[4] See `help:signal-flow`     - (filters, handling, etc.)

streams->reset!

clj

(streams->reset!)
Experimental, subject to change without notice!
+[4] See `help:signal-flow`     - (filters, handling, etc.)

streams->reset!

clj

(streams->reset!)
Experimental, subject to change.
 Resets `System/out` and `System/err` to their original value (prior to any
-`streams->telemere!` call).

streams->telemere!

clj

(streams->telemere!)(streams->telemere! {:keys [out err], :or {out default-out-opts, err default-err-opts}})
Experimental, subject to change without notice!
+`streams->telemere!` call).

streams->telemere!

clj

(streams->telemere!)(streams->telemere! {:keys [out err], :or {out default-out-opts, err default-err-opts}})
Experimental, subject to change.
 
 When given `out`, sets JVM's `System/out` to flush to Telemere signals with those opts.
 When given `err`, sets JVM's `System/err` to flush to Telemere signals with those opts.
diff --git a/taoensso.telemere.open-telemetry.html b/taoensso.telemere.open-telemetry.html
index 716588e..b6bae48 100644
--- a/taoensso.telemere.open-telemetry.html
+++ b/taoensso.telemere.open-telemetry.html
@@ -1,14 +1,23 @@
 
-taoensso.telemere.open-telemetry documentation

taoensso.telemere.open-telemetry

Core OpenTelemetry handler and utils.
+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!
 
-Needs `OpenTelemetry Java`,
-  Ref. <https://github.com/open-telemetry/opentelemetry-java>.

get-default-logger-provider

clj

(get-default-logger-provider)
Experimental, subject to change!! Feedback very welcome!
 Returns `io.opentelemetry.api.logs.LoggerProvider` via:
   `AutoConfiguredOpenTelemetrySdk` when possible, or
-  `GlobalOpenTelemetry` otherwise.

handler:open-telemetry-logger

clj

(handler:open-telemetry-logger)(handler:open-telemetry-logger {:keys [logger-provider attrs-key], :or {logger-provider (get-default-logger-provider), attrs-key :open-telemetry-attrs}})
Experimental, subject to change!! Feedback very welcome!
+  `GlobalOpenTelemetry` otherwise.
+
+See the relevant `opentelemetry-java` docs for details.

handler:open-telemetry-logger

clj

(handler:open-telemetry-logger)(handler:open-telemetry-logger {:keys [logger-provider attrs-signal-key], :or {logger-provider (default-logger-provider), attrs-signal-key :open-telemetry/attrs}})
Experimental, subject to change. Feedback welcome!
+
+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`.

IAttr+

protocol

clj

\ No newline at end of file + returned by given `io.opentelemetry.api.logs.LoggerProvider`. + +Options: + `:logger-provider` - `io.opentelemetry.api.logs.LoggerProvider` + Defaults to the LoggerProvider returned by (default-logger-provider), + see that docstring for details.

IAttr+

protocol

clj

\ No newline at end of file diff --git a/taoensso.telemere.postal.html b/taoensso.telemere.postal.html new file mode 100644 index 0000000..695bdcf --- /dev/null +++ b/taoensso.telemere.postal.html @@ -0,0 +1,61 @@ + +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)

format-signal->subject-fn

clj

(format-signal->subject-fn)(format-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:
+    "INFO EVENT :taoensso.telemere.postal/ev-id1 - msg"

handler:postal

clj

(handler:postal)(handler:postal {:keys [postal/conn-opts postal/msg-opts format-signal-fn format-signal->subject-fn], :or {format-signal-fn (utils/format-signal->str-fn), format-signal->subject-fn (format-signal->subject-fn)}})
Experimental, subject to change. Feedback welcome!
+
+Needs `postal`,
+  Ref. <https://github.com/drewr/postal>.
+
+Returns a (fn handler [signal]) that:
+  - Takes a Telemere signal.
+  - Sends an email with formatted signal content to the configured recipient.
+
+Useful for emailing important alerts to admins, etc.
+
+NB can incur financial costs!!
+See tips section re: protecting against unexpected costs.
+
+Options:
+
+  `:postal/conn-opts` - Map of connection opts provided to `postal`
+    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......."}
+
+  `:postal/msg-opts` - Map of message options
+    Examples:
+      {:from "foo@example.com",        :to "bar@example.com"},
+      {:from "Alice <foo@example.com", :to "Bob <bar@example.com>"},
+      {:from "no-reply@example.com",   :to ["first-responders@example.com",
+                                              "devops@example.com"],
+       :cc "engineering@example.com"
+       :X-MyHeader "A custom header"}
+
+  `:format-signal-fn`          - (fn [signal]) => output, see `help:signal-formatters`
+  `:format-signal->subject-fn` - (fn [signal]) => email subject string
+
+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.
\ No newline at end of file diff --git a/taoensso.telemere.streams.html b/taoensso.telemere.streams.html index a620364..1c78ac4 100644 --- a/taoensso.telemere.streams.html +++ b/taoensso.telemere.streams.html @@ -1,11 +1,11 @@ -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 without notice!
+

streams->reset!

clj

(streams->reset!)
Experimental, subject to change.
 Resets `System/out` and `System/err` to their original value (prior to any
-`streams->telemere!` call).

streams->telemere!

clj

(streams->telemere!)(streams->telemere! {:keys [out err], :or {out default-out-opts, err default-err-opts}})
Experimental, subject to change without notice!
+`streams->telemere!` call).

streams->telemere!

clj

(streams->telemere!)(streams->telemere! {:keys [out err], :or {out default-out-opts, err default-err-opts}})
Experimental, subject to change.
 
 When given `out`, sets JVM's `System/out` to flush to Telemere signals with those opts.
 When given `err`, sets JVM's `System/err` to flush to Telemere signals with those opts.
diff --git a/taoensso.telemere.timbre.cljs.html b/taoensso.telemere.timbre.cljs.html
index c97a896..fcb192d 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/shut-down-handlers!`.
 
\ No newline at end of file diff --git a/taoensso.telemere.timbre.html b/taoensso.telemere.timbre.html index f638cd8..d6a9d8a 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 6b17dce..1034b92 100644
--- a/taoensso.telemere.tools-logging.html
+++ b/taoensso.telemere.tools-logging.html
@@ -1,11 +1,11 @@
 
-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?]}.
 

tools-logging->telemere!

clj

(tools-logging->telemere!)
Configures `clojure.tools.logging` to use Telemere as its logging implementation.
 
-Called automatically if the following is true:
-  (get-env {:as :bool} :clojure.tools.logging/to-telemere)
-
-See `get-env` for details.

tools-logging->telemere?

clj

(tools-logging->telemere?)
Returns true iff `clojure.tools.logging` is configured to use Telemere
+Called automatically if one of the following is "true":
+        JVM property: `clojure.tools.logging.to-telemere`
+        Env variable: `CLOJURE_TOOLS_LOGGING_TO_TELEMERE`
+  Classpath resource: `clojure.tools.logging.to-telemere`

tools-logging->telemere?

clj

(tools-logging->telemere?)
Returns true iff `clojure.tools.logging` is configured to use Telemere
 as its logging implementation.
\ No newline at end of file diff --git a/taoensso.telemere.utils.cljs.html b/taoensso.telemere.utils.cljs.html index 1f00fc1..b8bc53b 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-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.
@@ -35,14 +35,14 @@ Returns a (fn format->json [signal]) that:
   - Takes a Telemere signal.
   - Returns JSON string of the (minified) signal.
 
-(Clj only): An appropriate `:pr-json-fn` MUST be provided.

format-signal->str-fn

clj

cljs

(format-signal->str-fn)(format-signal->str-fn {:keys [format-signal-prelude-fn format-nsecs-fn format-error-fn], :or {format-signal-prelude-fn (format-signal-prelude-fn), format-nsecs-fn (format-nsecs-fn), format-error-fn (format-error-fn)}})
Experimental, subject to change.
-Returns a (fn format->str [signal]) that:
-  - Takes a Telemere signal.
-  - Returns a formatted string intended for text consoles, etc.

format-signal-prelude-fn

clj

cljs

(format-signal-prelude-fn)(format-signal-prelude-fn {:keys [format-inst-fn], :or {format-inst-fn (format-inst-fn)}})
Experimental, subject to change.
+(Clj only): An appropriate `:pr-json-fn` MUST be provided.

format-signal->prelude-fn

clj

cljs

(format-signal->prelude-fn)(format-signal->prelude-fn {:keys [format-inst-fn], :or {format-inst-fn (format-inst-fn)}})
Experimental, subject to change.
 Returns a (fn format [signal]) that:
   - Takes a Telemere signal.
   - Returns a formatted prelude string like:
-    "2024-03-26T11:14:51.806Z INFO EVENT Hostname taoensso.telemere(2,21) ::ev-id - msg"

js-console-logger

cljs

(js-console-logger level)
Returns JavaScript console logger to match given signal level:
+    "2024-03-26T11:14:51.806Z INFO EVENT Hostname taoensso.telemere(2,21) ::ev-id - msg"

format-signal->str-fn

clj

cljs

(format-signal->str-fn)(format-signal->str-fn {:keys [format-signal->prelude-fn format-nsecs-fn format-error-fn], :or {format-signal->prelude-fn (format-signal->prelude-fn), format-nsecs-fn (format-nsecs-fn), format-error-fn (format-error-fn)}})
Experimental, subject to change.
+Returns a (fn format->str [signal]) that:
+  - Takes a Telemere signal.
+  - Returns a formatted string intended for text consoles, etc.

js-console-logger

cljs

(js-console-logger level)
Returns JavaScript console logger to match given signal level:
   `:trace` -> `js/console.trace`,
   `:error` -> `js/console.error`, etc.
 
@@ -55,4 +55,5 @@ Returns minimal signal map, removing:
 Useful when serializing signals to edn/JSON/etc.

newline

clj

cljs

added in Encore v3.68.0 (2023-09-25)

Single system newline
 

pr-edn

clj

cljs

(pr-edn x)
Prints given arg to an edn string readable with `read-edn`.
 

pr-json

cljs

added in Encore v3.98.0 (2024-04-08)

(pr-json x)
Returns given Cljs argument as JSON string.
+

remove-kvs

clj

cljs

(remove-kvs signal)
Returns the given signal without user-level kvs.
 
\ No newline at end of file diff --git a/taoensso.telemere.utils.html b/taoensso.telemere.utils.html index 6ca2377..1c227f4 100644 --- a/taoensso.telemere.utils.html +++ b/taoensso.telemere.utils.html @@ -1,22 +1,25 @@ -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!!
+that indicates that it's an error.

file-writer

clj

(file-writer file append?)
Experimental, subject to change. Feedback welcome!
 
 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.
 
-Thread safe. Automatically creates file and parent dirs as necessary.
-Writers MUST ALWAYS be manually closed after use!
+Useful for basic handlers that write to a file, etc.
 
-Useful for handlers that write to files, etc.

format-error-fn

clj

cljs

(format-error-fn)(format-error-fn {:as _opts})
Experimental, subject to change.
+Notes:
+  - Automatically creates file and parent dirs as necessary.
+  - Writer should be manually closed after use (with zero-arity call).
+  - Flushes after every write.
+  - 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 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.
@@ -44,14 +47,14 @@ Returns a (fn format->json [signal]) that:
   - Takes a Telemere signal.
   - Returns JSON string of the (minified) signal.
 
-(Clj only): An appropriate `:pr-json-fn` MUST be provided.

format-signal->str-fn

clj

cljs

(format-signal->str-fn)(format-signal->str-fn {:keys [format-signal-prelude-fn format-nsecs-fn format-error-fn], :or {format-signal-prelude-fn (format-signal-prelude-fn), format-nsecs-fn (format-nsecs-fn), format-error-fn (format-error-fn)}})
Experimental, subject to change.
-Returns a (fn format->str [signal]) that:
-  - Takes a Telemere signal.
-  - Returns a formatted string intended for text consoles, etc.

format-signal-prelude-fn

clj

cljs

(format-signal-prelude-fn)(format-signal-prelude-fn {:keys [format-inst-fn], :or {format-inst-fn (format-inst-fn)}})
Experimental, subject to change.
+(Clj only): An appropriate `:pr-json-fn` MUST be provided.

format-signal->prelude-fn

clj

cljs

(format-signal->prelude-fn)(format-signal->prelude-fn {:keys [format-inst-fn], :or {format-inst-fn (format-inst-fn)}})
Experimental, subject to change.
 Returns a (fn format [signal]) that:
   - Takes a Telemere signal.
   - Returns a formatted prelude string like:
-    "2024-03-26T11:14:51.806Z INFO EVENT Hostname taoensso.telemere(2,21) ::ev-id - msg"

host-ip

clj

(host-ip timeout-msecs timeout-val)(host-ip)
Returns cached local host IP address string, or `timeout-val` (default "UnknownHost").
+    "2024-03-26T11:14:51.806Z INFO EVENT Hostname taoensso.telemere(2,21) ::ev-id - msg"

format-signal->str-fn

clj

cljs

(format-signal->str-fn)(format-signal->str-fn {:keys [format-signal->prelude-fn format-nsecs-fn format-error-fn], :or {format-signal->prelude-fn (format-signal->prelude-fn), format-nsecs-fn (format-nsecs-fn), format-error-fn (format-error-fn)}})
Experimental, subject to change.
+Returns a (fn format->str [signal]) that:
+  - Takes a Telemere signal.
+  - Returns a formatted string intended for text consoles, etc.

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:
@@ -60,6 +63,7 @@ Returns minimal signal map, removing:
 
 Useful when serializing signals to edn/JSON/etc.

newline

clj

cljs

added in Encore v3.68.0 (2023-09-25)

Single system newline
 

pr-edn

clj

cljs

(pr-edn x)
Prints given arg to an edn string readable with `read-edn`.
+

remove-kvs

clj

cljs

(remove-kvs signal)
Returns the given signal without user-level kvs.
 

thread-id

clj

(thread-id)
Returns long id of current thread.
 

thread-name

clj

(thread-name)
Returns string name of current thread.
 
\ No newline at end of file