-
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
Using capitalized function names #19
Comments
Maybe. I think it might be better to try to integrate this into |
I still think that integration with Base is the way to go. Basically, one should be able to write code with standard Julia where the output just gets printed normally and then load a logging package that plugs into that and changes how logging is handled (written to log files, syslogd, etc.). I.e. a single common interface that has a trivial default backend (printing to stderr), but which different backends can be swapped. |
@StefanKarpinski, the question is how far design should go. Because I would prefer something similar to Log4j (with multiple loggers, format serializers & writers) to be able to output not only text but any data. However, I do not see it in scope of standard library. There going to be many implementations of loggers with different designs, the problem is how they going to interact with something permanently fixed in standard library. Look at definition of warn(msg...; kw...) = warn(STDERR, msg...; kw...) It binds abstract Appender
type STDERRAppender <: Appender
...
end
warn(msg...; kw...) = warn(STDERRAppender, msg...; kw...) but any abstraction of the output does not change the fact that there must be some configuration state inside the standard library that must be overwritten with a new setting. Let's say we can solve the shared configuration issue with multiple loggers, each with its own configuration (we'll skip discussion about how this pool of loggers in What if we could make the following:
Here is possible implementation of above (proof-of-concept). This will solve dependency on the shared configuration state, but it is a bit awkward from design perspective - "special" logging constant object, really!? And then to the issue topic - capitalized logging function names - there some functions that I would like to redefine for my own logging calls like |
How about to introduce capitalized function names: TRACE, WARN, DEBUG, INFO, ERROR, FATAL?
This will solve problems with multiple dispatch warning on Base functions. There is already crippled
err
call, capitalized function names will help to avoid further interference with standard library.The text was updated successfully, but these errors were encountered: