Skip to content

Commit

Permalink
[mod] Rename taoensso.telemere.api -> taoensso.telemere.shell
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Sep 9, 2024
1 parent 3f4f2f4 commit 1da9323
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion projects/main/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions projects/main/test/taoensso/telemere_tests.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions projects/api/project.clj → projects/shell/project.clj
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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!
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions wiki/9-Authors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
))

Expand Down Expand Up @@ -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.

0 comments on commit 1da9323

Please sign in to comment.