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

Logs not showing up in repl when using Clojure CLI #359

Closed
noahmoss opened this issue Aug 2, 2021 · 10 comments
Closed

Logs not showing up in repl when using Clojure CLI #359

noahmoss opened this issue Aug 2, 2021 · 10 comments

Comments

@noahmoss
Copy link

noahmoss commented Aug 2, 2021

Hi @liquidz!

At Metabase we just switched from using Leiningen to using the Clojure CLI with deps.edn.

vim-iced is working pretty smoothly still, however I have one issue: logs are not showing up in the repl when I start it with iced repl --without-cljs -A:dev. Logs do work properly, however, when I start the repl with clj -A:dev, so it seems like might be a problem with the iced command? We are using clojure.tools.logging and log4j2, and printing to stdout still works fine, just not logging.

Do you have any idea what the problem might be? Thanks!

@liquidz
Copy link
Owner

liquidz commented Aug 2, 2021

@noahmoss Thanks for your reporting!

As far as I tried, it seems cider-nrepl's wrap-debug middleware is the cause.
I'll dig into the problem later.

As a workaround, editing /your-iced-directory/bin/iced like follows will show logs in your REPL (but you cannot use debugging feature of course)

-BASE_MIDDLEWARES='cider.nrepl/wrap-classpath cider.nrepl/wrap-clojuredocs cider.nrepl/wrap-complete cider.nrepl/wrap-debug cider.nrepl/wrap-format cider.nrepl/wrap-info cider.nrepl/wrap-macroexpand cider.nrepl/wrap-ns cider.nrepl/wrap-out cider.nrepl/wrap-refresh cider.nrepl/wrap-spec cider.nrepl/wrap-test cider.nrepl/wrap-trace cider.nrepl/wrap-undef cider.nrepl/wrap-xref refactor-nrepl.middleware/wrap-refactor iced.nrepl/wrap-iced'
+BASE_MIDDLEWARES='cider.nrepl/wrap-classpath cider.nrepl/wrap-clojuredocs cider.nrepl/wrap-complete cider.nrepl/wrap-format cider.nrepl/wrap-info cider.nrepl/wrap-macroexpand cider.nrepl/wrap-ns cider.nrepl/wrap-out cider.nrepl/wrap-refresh cider.nrepl/wrap-spec cider.nrepl/wrap-test cider.nrepl/wrap-trace cider.nrepl/wrap-undef cider.nrepl/wrap-xref refactor-nrepl.middleware/wrap-refactor iced.nrepl/wrap-iced'

@noahmoss
Copy link
Author

noahmoss commented Aug 3, 2021

Awesome, thanks!

@liquidz
Copy link
Owner

liquidz commented Aug 3, 2021

@noahmoss Instead of cider-nrepl 0.26.0, 0.25.11 seems work well.
So I downgraded cider-nrepl to 0.25.11 for now, and cut a new release #360
Could you try latest version?

I'll continue to dig into cider-nrepl's problem.

@noahmoss
Copy link
Author

noahmoss commented Aug 3, 2021

@liquidz Yes, downgrading seems to have fixed it, thanks!

@bootleq
Copy link
Contributor

bootleq commented Dec 23, 2021

We should still consider upgrading cider-nrepl, recently I am suffering problem like clojure-emacs/cider-nrepl#719, where re-throwed exception may block iced from reporting test error.

I am using aforementioned workaround editing bin/iced to specify cider-nrepl 0.27.3 currently.

@liquidz
Copy link
Owner

liquidz commented Dec 23, 2021

@bootleq Sorry to bother you.
Yes, we should.
I'll test the latest cider-nrepl this weekend.

liquidz added a commit that referenced this issue Dec 24, 2021
@liquidz
Copy link
Owner

liquidz commented Dec 24, 2021

@bootleq
I just updated cider-nrepl to 0.27.4 in dev branch for now.

@noahmoss
Currently, logs seem to be shown on REPL in my environment.
Could you try dev branch?

@noahmoss
Copy link
Author

@liquidz Just tried the dev branch and logging seems to be working!

@liquidz
Copy link
Owner

liquidz commented Dec 28, 2021

@noahmoss Thanks for your confirmation!

@liquidz
Copy link
Owner

liquidz commented Dec 28, 2021

@noahmoss @bootleq Just released v3.7.3 #377

@liquidz liquidz closed this as completed Dec 28, 2021
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

3 participants