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

Memento Logging? #218

Closed
rofinn opened this issue Mar 12, 2018 · 11 comments
Closed

Memento Logging? #218

rofinn opened this issue Mar 12, 2018 · 11 comments

Comments

@rofinn
Copy link
Contributor

rofinn commented Mar 12, 2018

Any interest in switching over to using Memento.jl for logging? We're finding that PowerModels.jl throws a lot of warning under some specific circumstances and it would be nice if we could configure PowerModels.jl logging on the application side. We're just using Suppressor.jl for now, but it would be nice if we could have a more flexible solution.

@ccoffrin
Copy link
Member

This is what I use during testing,

using Logging
Logging.configure(level=ERROR)

Will this suit your needs as well?

@rofinn
Copy link
Contributor Author

rofinn commented Mar 12, 2018

Hmmm, I'd rather avoid dependencies that haven't been updated in while, but yes, that would work. Would you be willing to create a package level logger[1] that we can configure to avoid any conflicts with other packages that might be using Logging.jl?

const LOGGER = Logger("PowerModels")

Then we could do Logging.configure(PowerModels.LOGGER, level=ERROR) in our code.

@ccoffrin
Copy link
Member

ccoffrin commented Mar 12, 2018

Yes, I am fine making the currently logger at the package level.

I had not realized that Logger has not been updated recently. In fact, I probably have not looked at it for over a year.

If you all are committed to continuing to maintain the Memento package, I am open to migrating to it. It looks pretty nice! I noticed that it is not currently passing on v0.7, and plans for when that will be resolved?

@rofinn
Copy link
Contributor Author

rofinn commented Mar 12, 2018

Yeah, most of our internal and external packages depend on Memento, so I don't see us dropping it any time soon. Given that the logging functionality on 0.7 is still pretty limited, I'm guessing we'll be maintaining Memento until at least the Julia v2.0 release. That being said, we do have plans to add base logging integration once 0.7 is release, allowing you to use Memento as a kind of backend to the base logging interface.

Currently, we don't prioritize getting tests passing on nightly until a release candidate is available.

@ccoffrin
Copy link
Member

Ok sounds good. One last question, in the interest of keeping PowerModels' dependencies light, is Base logging a viable option as well?

@rofinn
Copy link
Contributor Author

rofinn commented Mar 12, 2018

Yes, but it seems like the configuration options for base logging are fairly limited. If the basic configuration API is provided prior to the 0.7 release then I'd say yes and we could just hook into your logger via that, but I'm not clear on how likely that is at the moment.

Here are some of the relevant discussions if you're interested:

JuliaLang/julia#26265
JuliaLang/julia#25404

@ccoffrin
Copy link
Member

Thanks for the discussion. I am convinced that Memento is our best option for now. As we don't need all of the power of Memento we should revisit this decision later if some basic features make their way into Julia base.

A PR is welcome. Or you can suggest how to do the migration to Memento and I'll get to it in the next couple of weeks.

@rofinn
Copy link
Contributor Author

rofinn commented Mar 13, 2018

The migration should be pretty easy and I'm happy make the PR. Unfortunately, we dropped 0.5 a while ago... would you be willing to make 0.6 the minimum julia version supported going forward?

@rofinn rofinn mentioned this issue Mar 13, 2018
@ccoffrin
Copy link
Member

v0.6 min is fine. We have dropped v0.5 from CI any way.

@ccoffrin
Copy link
Member

Before I close this issue, can you provide a recommendation for how packages like https://github.com/lanl-ansi/PowerModelsAnnex.jl should use Memento? Should they define their own logger, or is it reasonable to piggy back on PowerModels' logger?

@rofinn
Copy link
Contributor Author

rofinn commented Mar 14, 2018

Yeah, I think reusing the PowerModels.jl logger would be fine in that case. It's also fine to have multiple loggers for a package (usually child loggers for submodules).

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