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

IJulia/kernel.jl should not change the global_logger #1018

Closed
bluesmoon opened this issue Jul 28, 2021 · 3 comments
Closed

IJulia/kernel.jl should not change the global_logger #1018

bluesmoon opened this issue Jul 28, 2021 · 3 comments

Comments

@bluesmoon
Copy link
Contributor

Hi,

I'm using IJulia v1.23.2 on julia 1.5.3

When we start IJulia kernels, we want logs sent to a log file. To do this, we add the following to our kernel.json:

-L /path/to/our/init.jl

And this init.jl file pulls in LoggingExtras, and sends logs to a file.

Unfortunately, it seems that after this has happened, kernel.jl's init() function runs, and changes the global_logger with these lines:

    logger = Base.CoreLogging.SimpleLogger(Base.stderr)
    Base.CoreLogging.global_logger(logger)

This causes logs to go to the notebook instead.

Would it be possible to make this a configurable option so that the global logger is changed only if that's what we want?

Thanks.

@fredrikekre
Copy link
Member

One option would be to use an ijulia startup file instead which is included after IJulia.init:

let startupfile = !isempty(DEPOT_PATH) ? abspath(DEPOT_PATH[1], "config", "startup_ijulia.jl") : ""

@bluesmoon
Copy link
Contributor Author

bluesmoon commented Jul 28, 2021 via email

@bluesmoon
Copy link
Contributor Author

Using startup_ijulia.jl worked well for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants