Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract file/line info from callsites? #107

Open
vemv opened this issue Dec 13, 2022 · 0 comments
Open

Extract file/line info from callsites? #107

vemv opened this issue Dec 13, 2022 · 0 comments

Comments

@vemv
Copy link

vemv commented Dec 13, 2022

Hi Bruno,

from a quick grepping it seems that the log macro does not extract the file and line from the callsite.

Such info would seem 1) just data, just like any other (and therefore cheap, in an "open world" following Clojure's philosophy) and 2) an overall useful piece of information that can accelerate debugging time and/or be integrated with misc tooling (e.g. something like the datadog github integration, which shows your relevant clj source code right next to your data).

I wonder if this is a feature you've considered, and if so, why would it might not be a good idea to capture this info.

Worst-case scenario, I reckon that one could craft his own minimalistic log macro that wrapped mulog's, with an extra μ/with-context being macroexpanded:

;; approximate pseudo-code
(defmacro log [& xs]
  `(com.brunobonacci.mulog/with-context ~(select-keys (meta &env) [:file :line :column])
     ~(apply list 'com.brunobonacci.mulog/log xs)))

...However It would be more comfortable to stick to an official API, or at least learn a bit about your thinking.

Cheers - V

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant