markx
2018-8-3 14:52:28

@greg Thanks for the example, but I’m still very confused…


markx
2018-8-3 14:53:26

First of all, what does the default logger, the (current-logger) logger, do? Where does it output the logs?


markx
2018-8-3 14:56:33

Second, What does a log receiver do? What problem does it solve? When should I use it?


soegaard2
2018-8-3 14:58:04

@markx If you are using DrRacket, you can find the logger in the “View” menu.


greg
2018-8-3 15:07:54

@markx You can simply use printf. Seriously. I often do. It’s a time-honored tradition. There are two problems (you might or might not have) which loggers solve: 1- At runtime you want toggle which sets of messages are displayed. So, which logger “facility”, i.e. a define-logger name. 2- At runtime you want to set what level of messages are displayed (debug … fatal). And, if the string to display requires some expensive work to prepare, you’d like that work not to happen at all if the message won’t be displayed due to 1 or 2.


markx
2018-8-3 15:09:13

@soegaard2 Hmm, no I don’t use DrRacket. I just want to log to a file.


markx
2018-8-3 15:09:57

@greg But what problems do logger receivers solve?


markx
2018-8-3 15:11:30

@greg And yeah I do want to use a logger, over printf. But I want to output logs to a file, or later maybe to cloudwatch or anything.


markx
2018-8-3 15:12:30

In the docs there’s this example: > (let ([my-log (open-output-string)]) (with-logging-to-port my-log (lambda () (log-warning "Warning World!") (+ 2 2)) 'warning) (get-output-string my-log)) "Warning World!\n"


greg
2018-8-3 15:13:17

There can be zero or more log receivers. Each can do something different. One displays. One writes to file. One writes to CloudWatch. Plus, each receiver can have its own level to show (just fatal, or, everything even debug).


markx
2018-8-3 15:13:18

But I don’t want to call this big chunk everytime I want to log, and I don’t want to open and close the file everytime I log something, I guess.


markx
2018-8-3 15:14:47

Ideally, I was looking for something like, I globally setup the logger to output to a file, and then later when I call log-info or whatever, that log will just go to the log file.


greg
2018-8-3 15:15:07

That’s described in the docs somewhere.


greg
2018-8-3 15:17:13

OK the syslog is described, but not your own file.


markx
2018-8-3 15:18:59

BTW is there a easy way to edit the docs? I often feel confused after reading the docs without examples. Unless it’s just me, or we should maybe put the stuff into the docs.


greg
2018-8-3 15:20:25

has to go AFK for an hour or two


markx
2018-8-3 15:28:18

OK I found this. A good example about log receivers. https://gist.github.com/Metaxal/6511048


philip.mcgrath
2018-8-3 20:54:45

Is there a reliable way to rebuild outdated bytecode files? I have tried raco setup --fast-clean && raco setup, which took forever but didn’t solve the problem.


soegaard2
2018-8-3 20:56:13

-j <n>, —jobs <n>, —workers <n> : Use <n> parallel jobs


soegaard2
2018-8-3 20:57:09

Can’t remember if raco setup uses 1 or more cores as default.


soegaard2
2018-8-3 20:57:24

Try -j 4 and see if it helps.


philip.mcgrath
2018-8-3 20:58:02

I think it uses all cores (I see e.g. “raco setup: 7 making:”), but the speed isn’t the problem.


soegaard2
2018-8-3 20:58:48

Is it the drracket zo-files, that aren’t updated?


philip.mcgrath
2018-8-3 21:00:02

It is all at the command line. After running the above I am still getting: Sapientia:config philip$ ./no-voyant-test.rkt instantiate-linklet: mismatch; reference to a variable that is unintialized; possibly, bytecode file needs re-compile because dependencies changed name: idY89.1 exporting instance: "/Applications/Racket v7.0/share/pkgs/srfi-lite-lib/srfi/14/char-set.rkt" importing instance: "/Applications/Racket v7.0/share/pkgs/srfi-lite-lib/srfi/13/string.rkt"


soegaard2
2018-8-3 21:00:45

Over my pay grade :slightly_smiling_face:


soegaard2
2018-8-3 21:01:22

Bot it says “possibly”, so maybe the problem is elsewhere?


philip.mcgrath
2018-8-3 21:03:26

It could be, but I’ve chased the error to srfi-lite-lib from net/cookies and web-server by deleting compiled/ directories.


soegaard2
2018-8-3 21:03:58

Does a test program that does nothing but requiring srfi/13 work?


philip.mcgrath
2018-8-3 21:06:23

Yes, I can run #lang racket (require srfi/13 srfi/14)


soegaard2
2018-8-3 21:06:38

That’s odd.


soegaard2
2018-8-3 21:07:28

Maybe it is a specific function / macro / variable from srfi–14 that causes the problem.


soegaard2
2018-8-3 21:08:30

The “name: idY89.1” might mean that it is produced by a macro.


soegaard2
2018-8-3 21:12:06

Work around: use srfi/14 instead of srfi-lite/14


soegaard2
2018-8-3 21:12:06

?


philip.mcgrath
2018-8-3 21:13:19

The thing is, my code doesn’t import any of those modules.


soegaard2
2018-8-3 21:13:30

Oh.


philip.mcgrath
2018-8-3 21:14:21

By running raco setup srfi net/cookies web-server ricoeur, I now get: instantiate-linklet: mismatch; reference to a variable that is unintialized; possibly, bytecode file needs re-compile because dependencies changed name: s:string-&gt;list exporting instance: "/Applications/Racket v7.0/share/pkgs/srfi-lite-lib/srfi/13/string.rkt" importing instance: "/Applications/Racket v7.0/share/pkgs/net-cookies-lib/net/cookies/common.rkt"


philip.mcgrath
2018-8-3 21:14:45

(where ricoeur is my collection)


soegaard2
2018-8-3 21:15:43

srfi/13/string.rkt is mentioned again


philip.mcgrath
2018-8-3 21:19:43

Yes, but then running raco setup --fast-clean srfi net/cookies web-server &amp;&amp; raco setup srfi net/cookies web-server ricoeur has now changed the error to: instantiate-linklet: mismatch; reference to a variable that is unintialized; possibly, bytecode file needs re-compile because dependencies changed name: idX25.1 exporting instance: "/Applications/Racket v7.0/share/pkgs/web-server-lib/web-server/http/cookie.rkt" importing instance: "/Applications/Racket v7.0/share/pkgs/web-server-lib/web-server/http/xexpr.rkt"


philip.mcgrath
2018-8-3 21:20:21

I’ve been chasing it from library to library, but I can’t get rid of it.


soegaard2
2018-8-3 21:21:27

what’s the difference between clean and fast-clean


lexi.lambda
2018-8-3 21:22:45

@philip.mcgrath have you just tried running raco setup without any arguments?


philip.mcgrath
2018-8-3 21:23:13

I’ve done raco setup --fast-clean &amp;&amp; raco setup


philip.mcgrath
2018-8-3 21:24:00

@soegaard2 "—fast-clean : Like —clean, but non-bootstrapping (can fail)"


philip.mcgrath
2018-8-3 21:27:06

@lexi.lambda I just ran raco setup with no arguments, and the error from my program changed to: instantiate-linklet: mismatch; reference to a variable that is unintialized; possibly, bytecode file needs re-compile because dependencies changed name: idY9.1 exporting instance: "/Applications/Racket v7.0/share/pkgs/web-server-lib/web-server/lang/web-cells.rkt" importing instance: "/Applications/Racket v7.0/share/pkgs/web-server-lib/web-server/lang/abort-resume.rkt"


lexi.lambda
2018-8-3 21:27:57

It does seem that the “possibly” part of the error message is not the right explanation, then. :)


philip.mcgrath
2018-8-3 21:28:13

IIRC that’s where the error was after raco setup --fast-clean &amp;&amp; raco setup, too, but doing it with --fast-clean took, like, maybe most of an hour, so I’m not eager to repeat that.


philip.mcgrath
2018-8-3 21:30:22

Interestingly, I just discovered that I get a different error from racket no-voyant-test.rkt than ./no-voyant-test.rkt. This version is: Sapientia:config philip$ racket no-voyant-test.rkt instantiate-linklet: mismatch; reference to a variable that is unintialized; possibly, bytecode file needs re-compile because dependencies changed name: idX89.1 exporting instance: "/Applications/Racket v7.0/share/pkgs/net-cookies-lib/net/cookies/server.rkt" importing instance: "/Applications/Racket v7.0/share/pkgs/web-server-lib/web-server/http/cookie.rkt"


lexi.lambda
2018-8-3 21:31:16

This reminds me of an issue I was having a couple months back, but I can’t remember the details precisely…


soegaard2
2018-8-3 21:32:44

“unintialized” an i is missing in the error message


soegaard2
2018-8-3 21:33:03

google pointed it out


lexi.lambda
2018-8-3 21:35:18

hah, so it is


philip.mcgrath
2018-8-3 21:46:52

That, at least, I know how to fix: https://github.com/racket/racket/pull/2209


philip.mcgrath
2018-8-3 22:00:25

It looks like which specific modules will be named in the error I’m getting is not deterministic. With no raco setup etc. in between, I can get, for example: Sapientia:config philip$ ./no-voyant-test.rkt instantiate-linklet: mismatch; reference to a variable that is unintialized; possibly, bytecode file needs re-compile because dependencies changed name: idY35.1 exporting instance: "/Applications/Racket v7.0/share/pkgs/srfi-lite-lib/srfi/29/localization.rkt" importing instance: "/Applications/Racket v7.0/share/pkgs/srfi-lite-lib/srfi/19/time.rkt" Sapientia:config philip$ ./no-voyant-test.rkt instantiate-linklet: mismatch; reference to a variable that is unintialized; possibly, bytecode file needs re-compile because dependencies changed name: s:string-&gt;list exporting instance: "/Applications/Racket v7.0/share/pkgs/srfi-lite-lib/srfi/13/string.rkt" importing instance: "/Applications/Racket v7.0/share/pkgs/net-cookies-lib/net/cookies/common.rkt"


philip.mcgrath
2018-8-4 01:13:50

I just tried deleting and replacing my Racket installation, and I still get the error.