Replies: 1 comment
-
|
Im wondering why this feature request didn't get more traction, that seems like that can be a common concern |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Current situation
We currently have the
Consolestandard implemented, but we don't implement it with the commonLogger,PrinterandFormatteroperations. This prevents crates using Boa from creating their own printers that will for example not print anything but save the result to a file or a database.Proposed feature
We should implement an easily replaceable
Printerthat would either be passed to the Realm / Interpreter, so that by default, theconsolewill work as it does now, but we should have a way of creating theconsoleobject to use a customPrinter.How do we do this?
We should have a
printerobject that implements thePrintertrait, which would be something like:Maybe the trait needs to be modified, and we would need a
LogLevelenum, but I think the implementation should go in this direction. The idea behind having the logger use&mut selfis because we might want a printer that stores the logs in memory, or in a buffer, or that usesWriteto write to a log file.What I'm not very sure is on what the
optionsshould be in thePrinter. Maybe we can just skip that argument for now.Beta Was this translation helpful? Give feedback.
All reactions