2

I want to limit the length of the *inferior-ensime-server-...* buffer to a few thousand lines.

This looks promising, from https://stackoverflow.com/a/11255400/1007926, but does not work in this case:

(add-hook 'compilation-filter-hook 'comint-truncate-buffer)
(setq comint-buffer-maximum-size 2000)

Is there an ENSIME server buffer hook that I can use in place of 'compilation-filter-hook?

Maybe these hooks can be used to truncate the buffer occasionally: https://github.com/ensime/ensime-emacs/blob/master/ensime-mode.el

Alejandro Alcalde
  • 5,990
  • 6
  • 39
  • 79
Peter Becich
  • 989
  • 3
  • 14
  • 30

2 Answers2

2

you can always supply your own logback.xml file by customising ensime-server-logback and then doing your own filtering.

https://github.com/ensime/ensime-emacs/blob/aafff027f40ea58e22538272edd0a5b676821978/ensime-vars.el#L85

fommil
  • 5,757
  • 8
  • 41
  • 81
  • I've tried supplying my own logback.xml and it's properly showing in the ensime server command line: `... -Dlogback.configurationFile=/Users/rk/emacs.d/ensime/logback.xml org.ensime.server.Server`, but it is not taking effect at all. – The Dude Sep 01 '17 at 15:17
0

It worked for me, I did a M-x customize-group ensime-server and then, in ensime-server-logback I had to set the path to the logback.xml as a string: "/home/user/.sbt/0.13/plugins/logback.xml". This is my logback:

<configuration>
  <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
    <resetJUL>true</resetJUL>
  </contextListener>
  <appender name="file" class="ch.qos.logback.core.FileAppender">
    <file>it.log</file>
    <append>false</append>
    <encoder>
      <pattern>%d{HH:mm:ss.SSS} %-5level %X{akkaSource} %logger{36} - %msg%n</pattern>
    </encoder>
  </appender>
  <root level="WARN">
    <appender-ref ref="file" />
  </root>
  <logger name="org.ensime" level="WARN" />
  <logger name="akka" level="WARN" />
</configuration>
Alejandro Alcalde
  • 5,990
  • 6
  • 39
  • 79