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

Allow logger creation during initialization #225

Open
elliottt opened this issue Aug 23, 2022 · 1 comment
Open

Allow logger creation during initialization #225

elliottt opened this issue Aug 23, 2022 · 1 comment
Labels
performance Issues related to performance

Comments

@elliottt
Copy link
Contributor

Consider only allowing loggers to be allocated during initialization, and throw if Fastly.getLogger is called during request handling.

@elliottt elliottt added the performance Issues related to performance label Aug 23, 2022
@JakeChampion
Copy link
Contributor

I believe this isn't meant to be 'only' during initialization, but 'also' during initialization as a way to improve performance but not be a confusing (and breaking) change.

Consider also allowing logger creation during initialization, but then throw if trying to log during initialization. This enables us to get the JS Object into memory during initialization, and during post-initialization when the log methods is called on the Logger instance, we can do the call to the host to retrieve the logger and log to it.

Note: This would mean that the constructor would not throw if called during initialization with a name that is valid but is not a name of an associated Logger on the Fastly Service. That error would be thrown when the log method is called.

@JakeChampion JakeChampion changed the title Only allow logger creation during initialization Allow logger creation during initialization Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issues related to performance
Projects
None yet
Development

No branches or pull requests

2 participants