-
Notifications
You must be signed in to change notification settings - Fork 50
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
Change logLevel at runtime #23
Comments
Hi there, You mean specifying the logLevels yourself ? Something like this?
|
Not exactly. I am fine with the available log levels, but I'd like to change the Does this make sense? Maybe this is actually possible, I just don't see any accessors to do this.
|
Hi @erodewald, I'm not yet convinced that this would be a desirable feature. Could you explain why? Is it not sufficient to set it in the options object ( production/dev ) ? Thanks! |
@justinkames I've seen other loggers that allow you to modify the "log level" at runtime. It's fine if you disagree with the validity of the use case, I'll just try to explain what I would use it for and if you're interested then we can talk about it more.
The problem I'm perceiving, is that you can only configure those settings upon initialization when you pass it the config object. Can that be done after initialization? If it can be, this issue can be closed. Thanks for reading. |
+1 This seems a valid use-case. I'd like to be able to instruct a (power)user to hit some magic button sequence and set the logging to debug. This will allow me to analyze problems with instances of my app running in cordova-based apps. |
Interesting, sounds like a valid use case. I'm going to work on this and get back to you guys when it's implemented. Feel free to submit pull requests as well at any time. |
Preliminary implementation
Hi Justin, |
@tuvokki I will, thanks! |
Implement logger change and test
Implement logger change and test
@justinkames I finally made some time to have another go at this one. Verified the working code + test. |
@justinkames I was trying like this: window.logOptions = {
isEnabled: true,
logLevel : isProduction ? 'error' : 'debug',
stringifyArguments : false,
showLogLevel : true,
showMethodName : true,
separator: '|',
showConsoleColors: true
};
Vue.use(VueLogger, window.logOptions); |
I've been very busy lately. Apologies. I'll review the PR of @tuvokki / implement this feature asap. |
Hi, |
It appears @tuvokki has accomplished some sort of ability to: Would it be possible to incorporate this great feature? 🙏🏻 |
This is a must feature. If there is a bug in a production and I have no idea where it comes from, I would ask a user to open the dev console and turn on more verbose logs. |
I solved it by adapt the initialization process: ` let urlParams = new URLSearchParams(window.location.search); const app = createApp({}) |
It doesn't appear that there is an options object for changing the global configuration of
Vue.$log
'slogLevel
. I would like to make it a user-defined option which won't work without that. Any ideas? Or would you accept a PR with that ability?The text was updated successfully, but these errors were encountered: