
@greg I am having an issue with racket-mode’s logger output. Here is an entry of my racket-logger-topic-level
Symbol: racket/contract
Symbol: error
But racket-mode still records warnings
in the Racket Logger
buffer, e.g.: [warning] racket/contract: building projection of contract #<flat-contract: full-tc-results/c> for
(build-context . #(struct:srcloc #<path:/home/capfredf/code/racket/racket/collects/racket/contract/private/prop.rkt> 384 0 12961 195))
(get/build-projection . #(struct:srcloc #<path:/home/capfredf/code/racket/racket/collects/racket/contract/private/guts.rkt> 946 0 33033 301))
(#f . #(struct:srcloc ".../private/opt.rkt" 245 15 7779 153))
(#f . #(struct:srcloc #<path:/home/capfredf/code/racket/racket/collects/racket/contract/private/guts.rkt> 906 4 31839 72))
(#f . #(struct:srcloc ".../private/arr-i.rkt" 855 8 38906 824))

> Here is an entry of my racket-logger-topic-level
> > Symbol: racket/contract
> > Symbol: error
> >
I’m not familiar with that??

It’s controlled by the Emacs customization variable racket-logger-config
. What’s your value for that?

You can set that using setq
, or using M-x customize
, or via the UI in racket-logger-mode
by pressing the l
(lower case L) key.


Sorry I meant racket-logger-config

I mean also the value is an association list, e.g. the default is '((cm-accomplice . warning)
(GC . info)
(module-prefetch . warning)
(optimizer . info)
(racket/contract . error)
(racket-mode-debugger . info)
(sequence-specialization . info)
(* . fatal))
so that format where you had Symbol: racket/contract
Symbol: error
confused me. What’s that from?

copied from the UI

I didn’t take a screenshot

wait a sec

Oh the customize UI. Sorry I understand now.

I think it is equivalent to the list your posted

Yep.

What if you try pressing g
to refresh, after making the change via M-x customize? Does that “kick it into effect”?

I mean g
in the *Racket Logger*
window.

Or, kill that buffer and do racket-logger
again?

Yes, I have killed that buffer. I’ll write more racket code if the logger buffer gets substantial large. [at some point yesterday, my Emacs used 14GB memory]

I think what’s going on is that, after changing that racket-logger-config
Emacs var, the value doesn’t get sent to the back end. It does happen when you use the l
key in the *Racket Logger*
buffer, it “activates” the new config. But that doesn’t happen via the M-x customize UI.

I think Emacs customization vars can provide a function to call after the value is changed from the customize UI, for stuff like this. Probably that’s the bug I should fix.

I thought that was the default setting for the racket mode logger. Actually I didn’t notice the racket-mode logger until today.

Personally I change the topics/levels from the l
key in the logger buffer, so I haven’t encountered this. But I should make it work for changing things from customize UI, too.

I restarted emacs several times because of memory issue yesterday, so I think the config should kick into effect after emacs restarted, but it didn’t help. (I have desktop-save mode enabled, not sure it had something to do with it)
this morning, i was trying to locate the memory issue and learned memory-report
, which led me to the culprit, the racket mode logger.
[that said, the logger mode is quite handy, I like it]

Oh. Hmm. If you have Emacs running now, and you do C-h v
and enter racket-logger-config
, what value does it show you?

The (* . fatal)
item in the default means, “for all topics not otherwise specified, show fatal”. Which should prevent you seeing warning
level for racket/contract
, already. Something weird is going on.

[Meanwhile I think the M-x customize thing is, if maybe not your core problem, definitely a possible confusion, so I made an issue for that: https://github.com/greghendershott/racket-mode/issues/631]

With the default racket-logger-config
, if I do (log-message (current-logger) 'warning 'racket/contract "hi")
in a REPL I do not see any message in the *Racket Logger*
buffer, as expected. As a sanity check. Whereas for (log-message (current-logger) 'fatal 'racket/contract "hi")
I do, as expected.

> (I have desktop-save mode enabled, not sure it had something to do with it) Maybe? Provided racket-logger-config
is already set to its default value by the time desktop-save mode creates buffers, it should be OK. But maybe desktop-save mode is contributing. It’s definitely an ingredient in the mix you have, which I don’t (I’ve never used it before). I can try to learn more about it and experiment…

I will write some code and see if those warnings pop out again

Good idea. I’ll see if I can get to that this weekend.