[mod] Rename taoensso.telemere.api -> taoensso.telemere.shell

This commit is contained in:
Peter Taoussanis 2024-09-07 18:14:33 +02:00
parent 965c2277fd
commit a9005e7f1c
6 changed files with 16 additions and 16 deletions

View file

@ -49,7 +49,7 @@
[[org.clojure/test.check "1.1.1"]
[org.clojure/tools.logging "1.3.0"]
[org.slf4j/slf4j-api "2.0.16"]
[com.taoensso/telemere-api "1.0.0-SNAPSHOT"]
[com.taoensso/telemere-shell "1.0.0-SNAPSHOT"]
[com.taoensso/telemere-slf4j "1.0.0-SNAPSHOT"]
#_[org.slf4j/slf4j-simple "2.0.16"]
#_[org.slf4j/slf4j-nop "2.0.16"]

View file

@ -8,7 +8,7 @@
:refer [signal! with-signal with-signals]
:rename {signal! sig!, with-signal with-sig, with-signals with-sigs}]
[taoensso.telemere.api :as api]
[taoensso.telemere.shell :as shell]
[taoensso.telemere.utils :as utils]
[taoensso.telemere.timbre :as timbre]
#_[taoensso.telemere.tools-logging :as tools-logging]
@ -275,7 +275,7 @@
[(is (= sv1 (read-string (pr-str sv1))))])))
(is (sm? (with-sig (api/signal! {:level :info})) {:level :info, :ns "taoensso.telemere-tests", :line :submap/some}) "API")])
(is (sm? (with-sig (shell/signal! {:level :info})) {:level :info, :ns "taoensso.telemere-tests", :line :submap/some}) "Shell API")])
(deftest _handlers
;; Basic handler tests are in Encore

View file

@ -1,6 +1,6 @@
(defproject com.taoensso/telemere-api "1.0.0-SNAPSHOT"
(defproject com.taoensso/telemere-shell "1.0.0-SNAPSHOT"
:author "Peter Taoussanis <https://www.taoensso.com>"
:description "Minimal Telemere facade API for library authors, etc."
:description "Minimal Telemere shell API for library authors, etc."
:url "https://www.taoensso.com/telemere"
:license

View file

@ -1,15 +1,15 @@
(ns taoensso.telemere.api
(ns taoensso.telemere.shell
"Experimental, subject to change.
Minimal Telemere facade API for library authors, etc.
Minimal Telemere shell API for library authors, etc.
Allows library code to use Telemere if it's present, or fall back to
something like tools.logging otherwise."
{:author "Peter Taoussanis (@ptaoussanis)"}
#?(:clj (:require [clojure.java.io :as jio])
:cljs (:require-macros [taoensso.telemere.api :refer [compile-if]])))
:cljs (:require-macros [taoensso.telemere.shell :refer [compile-if]])))
(comment
(require '[taoensso.telemere :as t] '[taoensso.encore :as enc])
(remove-ns 'taoensso.telemere.api)
(remove-ns 'taoensso.telemere.shell)
(:api (enc/interns-overview)))
#?(:clj
@ -53,7 +53,7 @@
#?(:clj
(defmacro signal!
"Experimental, subject to change.
Telemere facade API for library authors, etc.
Telemere shell API for library authors, etc.
Expands to `taoensso.telemere/signal!` call if Telemere is present.
Otherwise expands to arbitrary `fallback` opt form.
@ -65,8 +65,8 @@
(ns my-lib
(:require
[taoensso.telemere.api :as t] ; `com.taoensso/telemere-api` dependency
[clojure.tools.logging :as ctl] ; `org.clojure/tools.logging` dependency
[taoensso.telemere.shell :as t] ; `com.taoensso/telemere-shell` dependency
[clojure.tools.logging :as ctl] ; `org.clojure/tools.logging` dependency
))
(t/require-telemere-if-present) ; Just below `ns` form!
@ -85,7 +85,7 @@
{:arglists #_(taoensso.telemere.impl/signal-arglists :signal!) ; + fallback
'([{:as opts
:keys
[fallback, ; Unique to facade
[fallback, ; Unique to shell
#_defaults #_elide? #_allow? #_expansion-id, ; Undocumented
elidable? location #_location* inst uid middleware,
sample-rate kind ns id level when rate-limit,

View file

@ -35,7 +35,7 @@ This way your users can easily disable, decrease, or increase signal output from
## 3. Telemere as an optional dependency
Include the (super lightweight) [Telemere facade API](https://clojars.org/com.taoensso/telemere-api) in your **library's dependencies**.
Include the (super lightweight) [Telemere shell API](https://clojars.org/com.taoensso/telemere-shell) in your **library's dependencies**.
Your library will then be able to emit structured logs/telemetry **when Telemere is present**, or fall back to something like [tools.logging](https://github.com/clojure/tools.logging) otherwise.
@ -44,7 +44,7 @@ The main trade-off is that your signal calls will be more verbose:
```clojure
(ns my-lib
(:require
[taoensso.telemere.api :as t] ; `com.taoensso/telemere-api` dependency
[taoensso.telemere.shell :as t] ; `com.taoensso/telemere-shell` dependency
[clojure.tools.logging :as ctl] ; `org.clojure/tools.logging` dependency
))
@ -76,4 +76,4 @@ The main trade-off is that your signal calls will be more verbose:
:fallback (ctl/warn (str \"Hello world\" x))})
```
See [here](https://cljdoc.org/d/com.taoensso/telemere-api/CURRENT/api/taoensso.telemere.api) for more info.
See [here](https://cljdoc.org/d/com.taoensso/telemere-shell/CURRENT/api/taoensso.telemere.shell) for more info.