Comments (6)
Thanks! I hadn't realised that.
I might also PR some Sentry-related improvements at some point.
Cheers - V
from timbre.
@vemv Great! Just ping if you'd like an actual working example 👍
@NoahTheDuke Thanks for your help on this, your advice re: (fn [data]) -> ?data
was fundamentally correct 👍
from timbre.
I believe if a middleware returns nil
, then nothing is printed. See Architecture on the wiki, step 4: "Pass the data map through any middleware fns: (fn [data]) -> ?data. These may transform the data. If returned data is nil, end here and noop."
As an example, I have this in a test fixture, to not do any logging when testing our authorization endpoints:
(defn silence-auth-logs
[f]
(timbre/with-config
(update timbre/*config* :middleware conj
(fn [data]
(when-not (str/includes? (or (first (:vargs data)) "") "Incorrect authorization")
data)))
(f)))
from timbre.
But what if I have N appenders and I just want to drop it for Sentry?
That's the essence of my question.
from timbre.
Oh, my apologies. I missed that you meant a single appender of many. I'm not sure that answer.
from timbre.
Just have my hands a bit full atm, so apologies for the brief answer-
Timbre's appenders are ultimately just normal Clojure functions, so you can easily wrap them with whatever behaviour you like.
I.e. you can basically implement appender-specific "middleware" by hand - just wrap the handler function you want with something like this:
(fn my-wrapped-handler [data] (when (:?err data) (actual-handler data)))
Will check back tomorrow in case you need more details!
from timbre.
Related Issues (20)
- Why are my Timbre timezones different than the system ones? HOT 3
- [shadow-cljs] Invalid :refer, var taoensso.encore/have does not exist HOT 26
- IllegalAccessException when logging internal JDK exception (SunCertPathBuilderException) via `log/error` HOT 13
- shadow-cljs: Advanced build bloated since 6.0.3 HOT 6
- Exception thrown when log arguments have same name, but different separators HOT 2
- Timbre crashing Cider workflow (?) HOT 9
- Using TAOENSSO_TIMBRE_CONFIG_EDN environment variable leads to an execption HOT 4
- Need some help/advice: No debug or info level logging, and duplicated message content HOT 10
- Add console appender opt to control `:raw-console?` HOT 1
- Link to Portal Timbre guide HOT 1
- Latest release uses older com.taoensso/encore; order-dependent if used with e.g. Tufte HOT 2
- API docs link from README results in 404 HOT 3
- Graal optimizations may break uberjar running HOT 7
- Seeing a lot of deprecation warnings in our log HOT 13
- Lots of Encore warnings HOT 3
- How to add appenders in the edn configuration? HOT 5
- Timbre v6.5 HOT 1
- [TIMBRE WARNING]: `error-fn` failed, falling back to `pr-str` HOT 28
- how to use :min-level at the appender level based on namespace? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from timbre.