-
Notifications
You must be signed in to change notification settings - Fork 109
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
feat: logs tab #137
feat: logs tab #137
Conversation
✅ Deploy Preview for chimerical-kitsune-a0bfa0 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I don't know if it's a good idea to have a logs tab on the request panel, when the logs printed there are not specific to the request. The logs tab should probably be in the nav bar. Not sure where exactly it would look good though. |
Moved to NavBar as the proposal! |
That should be good. Instead of this: function interceptConsole(type: LogType): ConsoleMethod {
return (...args: any[]) => {
const timestampStyle = 'color: #4CAF50;'
const logMessage = `%c${getCurrentTimestamp()} - [${type.toUpperCase()}] - %c${argsMapping(args)}`
const resetStyle = 'color: inherit;'
originalConsoleMethods[type](logMessage, timestampStyle, resetStyle)
storeLog(type, args)
}
} Let's do this: function interceptConsole(type: LogType): ConsoleMethod {
return (...args: any[]) => {
const timestampStyle = 'color: #4CAF50;'
const logMessage = `%c${getCurrentTimestamp()} - [${type.toUpperCase()}]%c}`
const resetStyle = 'color: inherit;'
originalConsoleMethods[type](logMessage, timestampStyle, resetStyle, ...args)
storeLog(type, args)
}
} There's stuff like arraybuffer which can't be logged well by our arg mapping. Let's let console.method itself handle the args however it wants, so we get the benefits of devtools console. Treating it like text logging removes benefits like collapsing large arrays and so on. It would've been great if we could've gotten the logs modal to act like how data is logged and displayed in the devtools console. |
I wonder if we can use this: https://github.com/liriliri/luna/blob/master/src/console/README.md to enhance the logging. Just a thought. We can take this up at a later point if you don't have the time to look into this right now. |
Well, IMHO, with this iteration, let's just have the logs displayed as simple as it is. Then throughout the next iterations, it's definitely more rooms for improvements. |
Introducing Logs Modal
closes #130