-
Notifications
You must be signed in to change notification settings - Fork 26
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
RFC: Unexport logging functions #48
base: master
Are you sure you want to change the base?
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.
This is really great.
Is there a way that we can keep Logging.configure()
? Having a macro in the middle could be annoying.
README.md
Outdated
Logging.debug("debug message") | ||
Logging.info("info message") | ||
Logging.warn("warning message") | ||
Logging.err("error message") |
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.
Should this be Logging.error("")
now? (Saw a few more of these around)
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.
Thanks, fixed now!
Thanks @JoshChristie. I think I found all of the needed renames. Regarding keeping Until now, the recommended way to use The way I do that here is by importing deprecated versions of the functions in the Importing the functions in this way is a little sketchy--e.g., it doesn't work if you call An alternative would be to issue the deprecation warning, and then follow through in a month or three (or, e.g., when Julia v0.6 comes out). That might be fine (and the resulting code would be simpler), although we would have to live with the current behavior during that time (overwriting I'll try to get that PR out for comparison, and then we can make a decision. |
Thanks for the explanation. That makes sense. However, when i tried this out i get an error. Should this be a warning instead? julia> using Logging
julia> Logging.configure(level=INFO)
ERROR: The functional form of Logging.configure(...) is no longer supported.
Instead, call
Logging.@configure(...)
in (::Logging.#kw##configure)(::Array{Any,1}, ::Logging.#configure) at ./<missing>:0 One last thing, renaming in the README.md should be |
Yes, making it a warning would be better--I'll do that. |
What is the status of this PR? |
c3a1c2b
to
96678bc
Compare
* Rename remaining calls to `err` -> `error` * Fix test function for whether macros are loaded * Internally, call `_configure` instead of `configure`
* Fix `Symbol` depwarn in test * Use `Compat` for v0.4 compatibilty
* fix keyword handling in julia v0.6 * use Compat: @static * macro hygiene fixes * ensure that macros work inside modules too
96678bc
to
3da6d9e
Compare
* Not needed for functionality, and allows us not to depend on Compat.jl
Two of the logging functions (
info
andwarn
) conflict withfunctions in base, and
error
was originally namederr
for the samereason. Unexporting them removes these conflicts.
With this change, the functions will (eventually) have to be qualified.
A user can still call these directly without qualification (and without override warnings) with
Also deprecate
Logging.err
in favor ofLogging.error
. This wasn't possible before because of conflicts withBase.error
In order to properly deprecate the non-qualified version, the
Logging.configure
function was also removed in favor ofLogging.@configure
, and the unqualified names are imported (with a deprecation warning) when the user callsLogging.@configure
, but only if 1)Logging
was included withusing Logging
, and 2) the user hasn't already imported the names manually. (This required a few shenanigans, and might be brittle, but should work most of the time and should only be temporary--e.g., until Julia v0.6).Looking for comments. My plan would be to release this as v0.5 or later.
Cc: @sbchisholm @aviks @DanielArndt @joshday @lostanlen @JoshChristie @fiatflux @zxteloiv