Skip to content

Commit

Permalink
Update documentation for latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
axvr committed Jul 28, 2023
1 parent 26bf8f7 commit cfc07b7
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ This library is a simple Clojure logging facade that wraps SLF4J 2+ (the version

```clojure
;; tools.deps
com.kroo/epilogue {:mvn/version "0.1"}
com.kroo/epilogue {:mvn/version "0.2"}
;; Leiningen
[com.kroo/epilogue "0.1"]
[com.kroo/epilogue "0.2"]
```

Before you can use Epilogue, you will probably want to first configure all logs to go through SLF4J and then configure a logging backend. You can find an example Clojure project using Epilogue with [Logback][] in the "[examples](/examples/logback)" folder of this repository, which demonstrates how to set it up.
Expand Down Expand Up @@ -96,7 +96,7 @@ log/*context*
@log/*context*

;; Add global entries to the logging context.
(swap! log/*context* assoc :version "0.1")
(swap! log/*context* assoc :version "126bf8f7640989f39c3077933ae4e1c47e0a04eef")

;; Add entries within a dynamic scope.
(log/with-context {:correlation-id (random-uuid)}
Expand All @@ -111,12 +111,24 @@ log/*context*
```clojure
(require '[com.kroo.epilogue :as log :refer [defloggingmacro]])

;; ---

;; Log and throw an exception. (Logs at `:error` level by default.)

(log/raise "Something went wrong!" {:hello "world"})

(catch Throwable e
(log/raise "Something went wrong!" {:hello "world"}
:cause e))

(log/raise "Help!" {:foo 123} :level :warn)

;; ---

;; Create your own logging macros with `defloggingmacro`. It automatically
;; preserves the correct source file, line and column numbers. Use it exactly
;; as you would `defmacro`.

(defloggingmacro my-info
"Custom version of `log/info` that has the \"data\" and \"message\" params
the other way around, and expects \"opts\" to be passed as a map instead of
Expand Down

0 comments on commit cfc07b7

Please sign in to comment.