Logging.jl icon indicating copy to clipboard operation
Logging.jl copied to clipboard

Overwriting Base.info and Base.warn

Open joshday opened this issue 10 years ago • 5 comments
trafficstars

I would like to use Logging in a package, but import Logging overwrites Base.info and Base.warn, which I don't want to enforce on users. Could this be reconsidered?

joshday avatar Nov 13 '15 13:11 joshday

From the documentation: "By default, Logging.info masks Base.info. However, if Base.info is called before using Logging, info will always refer to the Base version."

Does this help?

aviks avatar Nov 13 '15 13:11 aviks

I think that adds confusion. I would like to import Logging into my package OnlineStats.jl, but I don't think I can add a dependency for which I have to warn users about overwriting Base methods.

joshday avatar Nov 13 '15 14:11 joshday

What about using different names like nfo and wrn (or something better)?

lendle avatar Dec 13 '15 23:12 lendle

I think something like Logging.info() is more acceptable than overwriting the Base.

zxteloiv avatar Apr 26 '16 05:04 zxteloiv

I think something like Logging.info() is more acceptable than overwriting the Base.

I wish that the package name were shorter, but I generally agree. I'll put forth a pull request which stops exporting all functions, and solicit feedback.

@tkelman, any feedback on perhaps changing the name of this package to Log.jl, so that the logging functions could then be called as

Log.info(...)
Log.warn(...)
Log.error(...)

etc.? Do you think that would be acceptable, or is it taking too much liberty with the name? (I guess that would conflict with the same name being used in Base...)

kmsquire avatar Oct 07 '16 03:10 kmsquire