Fork me on GitHub
#cider
<
2017-02-03
>
bozhidar06:02:49

@luxbock Doesn't it just prompt you for the host and the port? What exactly is your issue?

bozhidar06:02:02

@dpsutton re the cljs repl - as we're using nREPL for it we can use the self-hosted cljs anyways, that's the reason why we end up with two repls

bozhidar06:02:29

we can probably hide one of them, but nobody's going to gain anything from this

bozhidar06:02:40

that's less than ideal, but without either an nREPL server that works on cljs or adding support for the built-in socket repl that's the best we can do for now

luxbock06:02:19

@bozhidar yes, I've tried entering "localhost" and "0.0.0.0" for host, and calling (cider-connect "localhost" "7888") directly but I get "[nREPL] Direct connection failed", yet lein :connect 7888 works and I confirmed that I'm connecting to the process started by invoking the jar file

luxbock06:02:05

ah, think I just figured out what was wrong, I was trying to call the command from a buffer associated with a file which was not in the same directory as for where I invoked the jar file from

richiardiandrea06:02:33

@luxbock I guess Bozhidar was saying that it should prompt when you call it with M-x (no params)

luxbock06:02:24

@richiardiandrea yeah, I tried as many combinations for host and port I could think of but I didn't realize the directory needed to match as well

luxbock06:02:27

sorry for the confusion

richiardiandrea06:02:25

What happens when you just call cider-connect?

richiardiandrea06:02:28

It is C-c M-c iirc

luxbock06:02:13

@richiardiandrea I get prompted for host and port, for which I tried a number of combinations but it always failed to connect, but as I said the issue was stemming from calling the command from a buffer which was associated with a different directory from where I had invoked the JAR from

richiardiandrea06:02:38

Hm it is weird because I do what you say all the time, say I have a repl on a project going and I want to debug lein-figwheel: I open the project with projectile in another frame and cider-connect to the running thing

luxbock06:02:12

@richiardiandrea I assume you start the REPL via lein figwheel in the project root?

richiardiandrea06:02:18

But OK, it is good that it works now :)

richiardiandrea06:02:29

No, via cider and boot

luxbock06:02:38

I had moved my JAR file into a ./release directory and invoked it from there

bozhidar07:02:08

I'm a bit confused by your explanations, but I'm happy you got it working 🙂

richiardiandrea18:02:27

is there a way for avoiding the prompt when the project contains both build.boot and project.clj?

christianromney19:02:26

is there a preferred way to run figwheel from cider? i've seen the instructions on the figwheel wiki, just wondering if there's a nicer way. i was considering setting cider-cljs-lein-repl via .dir-locals.el but would greatly appreciate any hard-won advice TIA

dpsutton19:02:42

@richiardiandrea

(defcustom cider-preferred-build-tool
  nil
  "Allow choosing a build system when there are many.
When there are artifacts from multiple build systems (\"lein\", \"boot\",
\"gradle\") the user is prompted to select one of them.  When non-nil, this
variable will suppress this behavior and will select whatever build system
is indicated by the variable if present.  Note, this is only when CIDER
cannot decide which of many build systems to use and will never override a
command when there is no ambiguity."
  :type '(choice (const "lein")
                 (const "boot")
                 (const "gradle")
                 (const :tag "Always ask" nil))
  :group 'cider
  :package-version '(cider . "0.13.0"))

zlrth20:02:11

i have an external service printing lots of logging through the buffer cider-repl my-project, so i set nrepl-log-messages to t, thinking that all logging would be redirected to nrepl-messages my-project. but all logging is now being printed to both cider-repl my-project and nrepl-messages my-project. can i suppress logging in cider-repl my-project?

dpsutton20:02:46

this is an issue that has been debated recently due to a bug fix

zlrth20:02:54

emacs (spacemacs) crawls when printing all that logging; that’s why i’m interested in this

dpsutton20:02:17

CIDER had in the past erroneously not passed writing to standard out back to the cider repl. This was fixed and is the behavior you are seeing

dpsutton20:02:34

at some place in your code you are writing to System/out, which only makes sense that it gets redirected to your repl

zlrth20:02:52

interesting. thanks.

dpsutton20:02:00

the idea is that you turned on console logging and attached a console

zlrth20:02:01

for me to fix this, i should change the code in the external service to print to something other than System/out?

dpsutton20:02:45

well your current logging strategy is to print to interested parties. This seems like a shortlived and bad logging strategy. would you prefer to write to a log file?

dpsutton20:02:55

also, your logging solution should have some idea of granularity, right?

dpsutton20:02:02

like info, debug, warning, error, fatal, etc

dpsutton20:02:06

can you raise the threshold?

dpsutton20:02:20

maybe you still want to see warnings but not info or debug so just raise the threshold?

zlrth20:02:24

i would much prefer to log to a file infos and debugs, and see warnings and errors. i’m pretty new as regards clojure. should i configure how i log things in clojure? all i know so far is the external service (java fwiw, EmbeddedSolrSolver) is printing everything

dpsutton20:02:15

@mfm that sounds like a good strategy but I don't have much experience in java

zlrth20:02:22

i’m worried that, i call basically (.doThing EmbeddedSolrServer), then EmbeddedSolrServer just System.out.printlns whatever it wants. i’m hoping that clojure logging can ingest those messages and filter them.

zlrth20:02:06

haven’t looked into how EmbeddedSolrServer does anything, though. nor do i know anything about clojure logging.

zlrth20:02:24

thanks very much dpsutton

dpsutton20:02:53

but how would you distinguish which writing to system out are important or not?

dpsutton20:02:34

Permanent Logging Settings
Solr uses Log4J version 1.2 for logging and is configured using server/resources/log4j.properties. Take a moment to inspect the contents of the log4j.properties file so that you are familiar with its structure. By default, Solr log messages will be written to SOLR_LOGS_DIR/solr.log.
When you're ready to deploy Solr in production, set the variable SOLR_LOGS_DIR to the location where you want Solr to write log files, such as /var/solr/logs. You may also want to tweak log4j.properties. Note that if you installed Solr as a service using the instructions provided at Taking Solr to Production, then see /var/solr/log4j.properties instead of the default server/resources version.
When starting Solr in the foreground (-f option), all logs will be sent to the console, in addition to solr.log. When starting Solr in the background, it will write all stdout and stderr output to a log file in solr-<port>-console.log, and automatically disable the CONSOLE logger configured in log4j.properties, having the same effect as if you removed the CONSOLE appender from the rootLogger manually.
Also, in log4j.properties the default log rotation size threshold of 4MB is most likely too small for production servers and should be increased to a larger value (such as 100MB or more).

hans22:02:31

Hi, is there a quick way to switch off cider's changing of font faces? I'm in a terminal and the faces are fine in clojure mode, but cider messes everything up with reverse and stuff.

dpsutton22:02:21

cider-font-lock-dynamically

dpsutton22:02:24

might be the ticket

dpsutton22:02:25

set that to nil

dpsutton22:02:51

> with reverse and stuff do you mean reverse from clojure.core?

dpsutton22:02:58

its font-locking all the clojure stuff?

hans22:02:18

it is (apparently) font-locking the functions it knows.

hans22:02:42

but setting c-f-l-d to nil helps, thanks a lot!

dpsutton22:02:23

yeah it asks the backend the core, macros, deprecated, etc and then font-locks them

dpsutton22:02:44

if you look at that var, you can set it to a few different values

hans22:02:30

it is nicely documented, yes. but i don't want to spend time on figuring out face configuration in this chain of terminal emulator and emacs, so nill will do 🙂

dpsutton22:02:48

haha sounds good. happy coding