Closed maacl closed 1 month ago
This happened to both of us as we were trying to use the Timbre integration.
The cider-log buffer is empty because JUL is chosen instead of Timbre, because JUL is determined as the sole available option, because Timbre cannot be loaded:
logjam.framework> (require 'logjam.framework.timbre :reload)
Syntax error (ArityException) compiling at (logjam/framework/timbre.clj:82:9).
Wrong number of args (1) passed to: taoensso.timbre/log!
This looks like a breaking change from Timbre's side. Should have a simple fix in Logjam.
@r0man Can you take a look at this?
Hi,
I had a quick look, but I'm having a hard time to reproduce this. This is what I did:
cider/cider-nrepl
is at version "0.50.2" (the one in the repo is missing a fix from @vemv)lein update-in :dependencies conj \[nrepl/nrepl\ \"1.3.0\"\] -- update-in :dependencies conj \[refactor-nrepl/refactor-nrepl\ \"3.10.0\"\] -- update-in :plugins conj \[refactor-nrepl/refactor-nrepl\ \"3.10.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.50.2\"\] -- with-profile +test repl :headless :host localhost
logjam.framework.timbre-test
M-x cider-log-show
(timbre/infof "foo %s" 42)
at line 66After doing so, I see the log line in the *cider-log*
buffer as:
2024-10-28 09:31:18.000 [nREPL-session-b3a1e5bc-fd2d-4d08-97cf-75ef5f18c554] INFO logjam.framework.timbre-test:66:5 - foo 42
I also see it in the REPL as:
2024-10-28T08:31:18.301Z precision INFO [logjam.framework.timbre-test:66] - foo 42
What I see in *cider-log*
looks good to me. The line in the REPL I would not have expected, but I guess this is Timbre's default logger. @vemv is this the expected behaviour when you implemented this? I'm not using Timbre and never tried it before with cider-log.
I opened a PR over here that updates some of logjams dependencies: https://github.com/clojure-emacs/logjam/pull/19
But this isn't fixing the issue at hand. It only includes a fix from @vemv in cider-nrepl which I run into while trying this in the logjam repository.
I need more information:
(require 'logjam.framework.timbre :reload)
How can I reproduce this?Hey @r0man , thanks for your efforts!
You are right, it works. What I had to do locally in my specific project was:
For a long while I was actually unable to upgrade Timbre/Encore in my work project, for contrived reasons. But now I finally can, and it all works.
I'd just add these some tips to the manual:
M-: (cider-sync-request:log-frameworks)
(require 'logjam.framework.timbre :reload)
logjam.framework/*frameworks*
You can try those right now, @maacl .
Cheers - V
Thanks @vemv. Maybe @maacl can come up with exact steps to reproduce this (in the logjam repo)?
Hey @r0man , thanks for your efforts!
You are right, it works. What I had to do locally in my specific project was:
- bump Timbre
bump Encore
- Timbre and Encore often have to be upgraded in concert, they use "break versioning"
For a long while I was actually unable to upgrade Timbre/Encore in my work project, for contrived reasons. But now I finally can, and it all works.
I'd just add these some tips to the manual:
Elisp side, one can
M-: (cider-sync-request:log-frameworks)
- if our framework of choice is absent, then things won't work properly and signals some problem
Clojure side, one can debug why a specific framework may be absent by running
(require 'logjam.framework.timbre :reload)
- Or any other such namespace listed in
logjam.framework/*frameworks*
- For Timbre specifically, it's often useful to have Timbre + Encore at latest stable.
You can try those right now, @maacl .
Cheers - V
M-: (cider-sync-request:log-frameworks)
gives me:
Debugger entered--Lisp error: (void-function cider-sync-request:log-frameworks)
(cider-sync-request:log-frameworks)
eval-expression((cider-sync-request:log-frameworks) nil nil 127)
funcall-interactively(eval-expression (cider-sync-request:log-frameworks) nil nil 127)
command-execute(eval-expression)
Try (require 'cider-log)
beforehand
This works for me now too. I think it was an timbre/encore version issue. Thanks.
I think we should probably add something in the docs, so that people are not surprised by such version combination issues.
I'm generally tight on time any given day so I'd appreciate if someone could add my recap to the manual https://github.com/clojure-emacs/cider/issues/3751#issuecomment-2441509389
I added something here: https://github.com/clojure-emacs/cider/pull/3753 Wdyt? I'm closing this one. I think we are done here.
Expected behavior
cider-log buffer receives and displays log messages.
Actual behavior
cider-log buffer remains empty and all messages are logged to the repl.
Steps to reproduce the problem
cider-log-show
Environment & Version information
WSL
CIDER version information
CIDER 1.15.1 (Cogne), nREPL 1.3.0, Clojure 1.12.0, Java 23
Lein / Clojure CLI version
See above.
Emacs version
29.4
Operating system
Ubuntu 22.04.5 LTS under WSL:
WSL version: 2.3.24.0 Kernel version: 5.15.153.1-2 WSLg version: 1.0.65 MSRDC version: 1.2.5620 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26100.1-240331-1435.ge-release Windows version: 10.0.22631.4317
JDK distribution
openjdk version "21.0.2" 2024-01-16 LTS OpenJDK Runtime Environment Temurin-21.0.2+13 (build 21.0.2+13-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.2+13 (build 21.0.2+13-LTS, mixed mode, sharing)