Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sync configure #12

Closed
AaronPorts opened this issue Sep 6, 2024 · 4 comments · Fixed by #29
Closed

Add sync configure #12

AaronPorts opened this issue Sep 6, 2024 · 4 comments · Fixed by #29

Comments

@AaronPorts
Copy link

I think async configuration is not very suitable for browsers.

@dahlia
Copy link
Owner

dahlia commented Oct 2, 2024

You don't have to prepend await for calling configure() unless you'd like to use sinks which are AsyncDisposable (e.g., stream sink). I'll add docs about this.

@skeet70
Copy link
Contributor

skeet70 commented Feb 6, 2025

This isn't squaring with my experience. I added a configure call at the top of the entrypoint (without a top level await because it isn't available to me). My only sink is the console. Immediately after configure, environment loading code is called, and if the server exits due to a missing environment variable with a message, that message will not appear. I tried stalling for up to a second (which allowed other messages to be printed from other points in the application) before exiting, but it seems like the logger instance the environment variable code has access to is a dead reference or something.

A real sync configure would likely prevent these problems. Likely if I started this server 1000 times some number of them would output the message due to the event loop happening to finish initializing the logger before moving to the environment statements.

@dahlia
Copy link
Owner

dahlia commented Feb 24, 2025

It will be shipped with the next minor release, LogTape 0.9.0. See also the related docs in advance.

@dahlia
Copy link
Owner

dahlia commented Mar 1, 2025

Now it's shipped with LogTape 0.9.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants