-
-
Notifications
You must be signed in to change notification settings - Fork 296
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
🧻 Julia Logging in browser console #496
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! I suggest the 📜 emoji for logging 😆
Mapping to the javascript console logger is a neat way to get UI functionality without a lot of up front work.
I suspect debug logging may be too verbose to use by default (as other packages may emit debug messages). I suggest we restrict debug messages to come from the user's notebook module only.
} | ||
|
||
export const handle_log = ({ level, msg, file, line, kwargs }, filename) => { | ||
const f = log_functions[level] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want a fallback here - it's possible for level
to be things which are not equal to the standard levels (see, for example the @progress
macro from ProgressLogging, which will cause errors on the javascript side.)
import ..Configuration: CompilerOptions | ||
import ..PlutoRunner | ||
import Distributed | ||
|
||
"Contains the Julia process (in the sense of `Distributed.addprocs`) to evaluate code in. Each notebook gets at most one `Workspace` at any time, but it can also have no `Workspace` (it cannot `eval` code in this case)." | ||
mutable struct Workspace | ||
pid::Integer | ||
log_channel::Distributed.RemoteChannel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd potentially suggest that you make this an AbstractLogger
instance, and wrap every invocation of a command within the workspace in a with_logger
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait, this is the recv
side? Seems good in that case.
A basic version of #437. It relays all Logging messages to the browser console (and also to the original terminal).
That PR will take a lot of work to get right, and it would be nice to have something simple before it it finished.