greg
2020-3-5 18:40:28

@d_run So loggers and receivers know about this extra data element. You can use that, and not need to re-invent a system that knows about loggers, levels, and receivers.

I think one caveat is that some log receivers will ignore the data value (e.g. not print/show/write it). So you might need to define/use your own. But you might have planned to do this, anyway.

Another caveat is that define-logger defines log-xxx wrappers around log-message that are “stringy”. However it’s not difficult to define such functions yourself, by hand. And probably not too difficult to make your own define-logger-like macro that does this.

Whether that qualifies as needing to roll your own system, I’ll let you judge. :simple_smile: IMHO I’d say no, not qualitatively — but there’s some small quantity of things you’d need to add.


samdphillips
2020-3-5 19:04:53

This was a half-hearted attempt at adding structured logging and log4j/python loggers to the builtin Racket logging. I never got around to making a log receiver that could handle the rich events. https://github.com/samdphillips/racket-utils/blob/master/utils/logging.rkt


d_run
2020-3-5 19:09:55

Ah i somehow missed the data element as i always have been using the log-xxx wrappers


greg
2020-3-5 19:16:50

I didn’t even know about it until I wrote my first log receiver, and I was like, “the data… what?” I don’t think it’s used frequently. But it’s there when you need it. If the logger system were the Win32 API, data would be the dwUser parameter. :wink:


d_run
2020-3-5 19:31:04

this is super helpful


spdegabrielle
2020-3-5 20:29:48

London Racket Meet-up 

Thursday 9th April 1–2pm

Meet at 1pm at ‘The Last Word’ (cafe)[1] and after introductions we will move to The Alan Turing Institute[2].

[1] The Last Word (cafe in front of British Library) 96 Euston Rd, London NW1 2DB  Google maps: https://goo.gl/maps/SbUeExYddSnWPQbz6 

[2] The Alan Turing Institute https://www.turing.ac.uk/

It will be casual introductions and chat, though if someone wants to do a short talk or demo that would be most welcome.

Please register at https://forms.gle/XDvr5gtGKb6K2DXh8 (required for access to Turing Institute meeting room)

Please let me know if you are interested, even if you can’t confirm attendance. 

Many thanks to Dr James Geddes and The Alan Turing Institute for hosting this event.

Kind regards,

Stephen


spdegabrielle
2020-3-5 20:31:05

PS subscribe to <https://racket-news.com|Racket News>


sorawee
2020-3-6 01:22:39

Is it expected that background expansion might not agree with actual run? I have a file whose background expansion consistently says instantiate-linklet: mismatch ..., but the actual run is fine.


sorawee
2020-3-6 01:23:43

As a follow-up, which one should I believe? Is it actually fine or not fine?


harry-chen
2020-3-6 07:40:06

@harry-chen has joined the channel