capfredf
2022-7-15 17:38:32

@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))


greg
2022-7-15 17:43:31

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


greg
2022-7-15 17:43:43

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


greg
2022-7-15 17:44:22

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.



capfredf
2022-7-15 17:52:31

Sorry I meant racket-logger-config


greg
2022-7-15 17:53:44

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?


capfredf
2022-7-15 17:54:32

copied from the UI


capfredf
2022-7-15 17:54:43

I didn’t take a screenshot


capfredf
2022-7-15 17:54:45

wait a sec


greg
2022-7-15 17:55:05

Oh the customize UI. Sorry I understand now.


capfredf
2022-7-15 17:55:11

I think it is equivalent to the list your posted


greg
2022-7-15 17:55:39

Yep.


greg
2022-7-15 17:56:13

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


greg
2022-7-15 17:56:26

I mean g in the *Racket Logger* window.


greg
2022-7-15 17:56:52

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


capfredf
2022-7-15 17:59:40

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]


greg
2022-7-15 17:59:43

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.


greg
2022-7-15 18:00:31

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.


capfredf
2022-7-15 18:01:19

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


greg
2022-7-15 18:01:19

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.


capfredf
2022-7-15 18:06:21

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]


greg
2022-7-15 18:08:12

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?


greg
2022-7-15 18:09:53

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.


greg
2022-7-15 18:11:17

[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]


greg
2022-7-15 18:14:28

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.


greg
2022-7-15 18:18:15

> (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…


capfredf
2022-7-15 19:43:47

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


massung
2022-7-15 23:39:47

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