Coder Social home page Coder Social logo

logging.jl's Introduction

Logging.jl: Basic logging for Julia

PkgEval: Julia v0.4 PkgEval: Julia v0.5 PkgEval: Julia v0.6

TravisCI: Linux, OSX AppVeyorCI: Windows

This module provides basic logging facilities for Julia. It was inspired somewhat by logging in Python.

Install with Pkg.add("Logging") at the Julia prompt.

Usage

If log_test.jl contains

using Logging
# default:
# Logging.configure(level=WARNING)

function log_test()
    debug("debug message")
    info("info message")
    warn("warning message")
    err("error message")
    critical("critical message")
end

println("Setting level=DEBUG")
Logging.configure(level=DEBUG)
log_test()

println()
println("Setting level=INFO")
Logging.configure(level=INFO)
log_test()

println()
println("Setting level=WARNING")
Logging.configure(level=WARNING)
log_test()

println()
println("Setting level=ERROR")
Logging.configure(level=ERROR)
log_test()

println()
println("Setting level=CRITICAL")
Logging.configure(level=CRITICAL)
log_test()

Running this gives

julia> include("log_test.jl")
Setting level=DEBUG
30-Oct 22:09:20:DEBUG:root:debug message
30-Oct 22:09:20:INFO:root:info message
30-Oct 22:09:20:WARNING:root:warning message
30-Oct 22:09:20:ERROR:root:error message
30-Oct 22:09:20:CRITICAL:root:critical message

Setting level=INFO
30-Oct 22:09:20:INFO:root:info message
30-Oct 22:09:20:WARNING:root:warning message
30-Oct 22:09:20:ERROR:root:error message
30-Oct 22:09:20:CRITICAL:root:critical message

Setting level=WARNING
30-Oct 22:09:20:WARNING:root:warning message
30-Oct 22:09:20:ERROR:root:error message
30-Oct 22:09:20:CRITICAL:root:critical message

Setting level=ERROR
30-Oct 22:09:20:ERROR:root:error message
30-Oct 22:09:20:CRITICAL:root:critical message

Setting level=CRITICAL
30-Oct 22:09:20:CRITICAL:root:critical message

At the Julia prompt, the messages will display in color (debug=cyan, info=blue, warning=purple, error=red, critical=red).

It is possible to change the stream the logger prints to. For example, to print to a file:

julia> Logging.configure(output=open("logfile.log", "a"))
julia> log_test()
julia> readlines(open("logfile.log"))
3-element Array{Union(ASCIIString,UTF8String),1}:
 "24-mar 18:40:24:WARNING:root:warning message\n"
 "24-mar 18:40:24:ERROR:root:error message\n"
 "24-mar 18:40:24:CRITICAL:root:critical message\n"

Since it is common to log to files, there is a shortcut:

julia> Logging.configure(filename="logfile.log")

Logging Macros

For the functions above, there is always a small overhead for the function call even when there is no log output. Logging.jl provides macros which work like the functions above, but which remove this overhead.

To use the macro versions, you MUST first configure them using @Logging.configure.

using Logging
@Logging.configure(level=DEBUG)

function macro_log_test()
    @debug("debug message")
    @info("info message")
    @warn("warning message")
    @err("error message")
    @critical("critical message")
end

macro_log_test()

This gives:

30-Oct 22:28:51:DEBUG:root:debug message
30-Oct 22:28:51:INFO:root:info message
30-Oct 22:28:51:WARNING:root:warning message
30-Oct 22:28:51:ERROR:root:error message
30-Oct 22:28:51:CRITICAL:root:critical message

Later, we may decide to turn off logging entirely:

using Logging
@Logging.configure(level=OFF)

function macro_log_test()
    @debug("debug message")
    @info("info message")
    @warn("warning message")
    @err("error message")
    @critical("critical message")
end

macro_log_test()

This prevents any of the logging code from being generated.

Note that changing the log level later in the code will not have any affect on previously evaluated functions, though it does affect future evaluation:

using Logging
println("Setting level=OFF")
@Logging.configure(level=OFF)

function macro_log_test()
    # logging is OFF above!
    # these messages will never produce output
    # even if the log level is changed
    @debug("debug message")
    @info("info message")
    @warn("warning message")
    @err("error message")
    @critical("critical message")
end

macro_log_test()

println("Setting level=DEBUG")
Logging.configure(level=DEBUG)
macro_log_test()

@warn("This warning message will print.")
@debug("So will this debug message!")

produces:

Setting level=OFF
Setting level=DEBUG
30-Oct 23:26:16:WARNING:root:This warning message will print.
30-Oct 23:26:16:DEBUG:root:So will this debug message!

More advanced usage

It is possible to create multiple loggers that each have their own log levels and can write to different streams. A specific logger is used by giving it as the first argument to the logger functions or macros.

julia> loggerA = Logger("loggerA");

julia> Logging.configure(loggerA, level=ERROR);

julia> Logging.configure(loggerA, filename="loggerA.log");

julia> loggerB = Logger("loggerB");

julia> Logging.configure(loggerB, level=DEBUG);

julia> critical(loggerA, "critical message from loggerA");

julia> readlines(open("loggerA.log"))
1-element Array{Union(ASCIIString,UTF8String),1}:
 "24-mar 18:48:23:CRITICAL:loggerA:critical message form loggerA\n"

julia> critical(loggerB, "critical message from loggerB");
24-mar 18:49:15:CRITICAL:loggerB:critical message from loggerB

A logger can be created with a parent logger. A logger with a parent inherits the configuration of the parent.

julia> mum_logger = Logger("Mum");
julia> Logging.configure(mum_logger, level=INFO);
julia> son_logger = Logger("Son", parent=mum_logger);
julia> son_logger.level
INFO

Notes

  • By default, Logging.info masks Base.info. However, if Base.info is called before using Logging, info will always refer to the Base version.
julia> info("Here's some info.")
INFO: Here's some info.

julia> using Logging
Warning: using Logging.info in module Main conflicts with an existing identifier.

julia> @Logging.configure(level=Logging.INFO)
Logger(root,INFO,TTY(open, 0 bytes waiting),root)

julia> info("Still using Base.info")
INFO: Still using Base.info

julia> Logging.info("You can still fully qualify Logging.info.")
17-Jan 13:19:56:INFO:root:You can still fully qualify Logging.info.

If this is not desirable, you may call @Logging.configure with override_info=true:

julia> info("Here's some info again.")
INFO: Here's some info again.

julia> using Logging
Warning: using Logging.info in module Main conflicts with an existing identifier.

julia> @Logging.configure(level=Logging.INFO, override_info=true)
Warning: Method definition info(AbstractString...,) in module Base at util.jl:216 overwritten in module Main at /Users/kevin/.julia/v0.4/Logging/src/Logging.jl:85.
Logger(root,INFO,TTY(open, 0 bytes waiting),root)

julia> info("Now we're using Logging.info")
17-Jan 13:17:20:INFO:root:Now we're using Logging.info

logging.jl's People

Contributors

aviks avatar danielarndt avatar kmsquire avatar kristofferc avatar r9y9 avatar ranjanan avatar rdeits avatar sbchisholm avatar scls19fr avatar sharnett avatar staticfloat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

logging.jl's Issues

Create tests which actually verify the logging output

Right now, the test files are good examples of logging functionality, but they don't actually validate that the debugging output is correct.

To fix this, the current "tests" should probably move to an examples directory, and tests should have tests which log to an IOBuffer.

Intended behavior?

I'm finding this confusing and unexpected:

julia> using Logging
julia> Logging.configure(level=DEBUG)
julia> @debug(y)
15-May 15:24:45:DEBUG:root:y

even though there's nothing called y in my name space. This is because of the way the arguments to @debug are escaped in the macro definition. On the other hand, if we define

julia> macro mydebug(msg...)
           if Logging.DEBUG < Logging._root.level
               :nothing
           else
               :(Logging.debug($(msg...)))   # <-- here's the change.
           end
       end

then @mydebug(y) throws an error, which I find much more intuitive. In addition, it allows me to define

debug_formatted(fmt, args...) = @eval @mydebug(@sprintf($fmt, $(args...)))

so that I can type

julia> debug_formatted("a = %d", 3)
15-May 15:24:31:DEBUG:root:a = 3

This lets me log dynamically-generated messages. I'm not sure how the overhead of @eval compares to that of debug(), but it shouldn't be as high because debug() itself starts with an @eval.

Display of LogLevel in log line

The loglevel in the logging line is displayed as LogLevel(WARNING) . This has 9 characters of redundant information. I think it would be better to display this simply as WARNING . Or better still, just WARN

Using Logging to send log to a notification service

Hello,

I wrote a tiny package named Pushover.jl.

It's using the Pushover Notification Service API (documented here) to send short message to Android, Iphone, desktop...

I'm looking for a way to integrate this package to a logging package ( scls19fr/Pushover.jl#1 )

I would like to be able to send for example only critical logs to Pushover.

Critical level logs should be both printed to stdout and sent to Pushover
but lower level log should only be printed to stdout

Any help will be great.

Kind regards

PS : sending critical logs could also be done using SMS (using for example BulkSMS.jl )

WARNING: Method definition info(Any...) in module Base at util.jl:334 overwritten...

When I type import Logging I get the warning

WARNING: Method definition info(Any...) in module Base at util.jl:334 overwritten in module Logging at /global/homes/j/jregier/.julia/v0.4/Logging/src/Logging.jl:61.

I can understand getting this warning if I were to type using Logging, but shouldn't info not get overwritten if I instead type import Logging?

SystemError: flush: Bad file descriptor on Travis but not on local machine

Hi there,

I am running the tests for LoggedDicts.jl, which uses Logging.jl as a dependency. On my local machine everything works well, but on Travis I consistently get the error: SystemError: flush: Bad file descriptor

Oddly, the error occurs on a line that is called several times without issue earlier in the test suite. The failure consistently occurs at the same call site (line 44 of test/runtests.jl).

It is unclear if this is a Logging.jl issue, a Travis issue or something that I'm doing wrong.
Have you seen this problem before?

Regards,
Jock

default root logger output results in a `TTY(invalid status, ...)` on 0.4

So I initially came across this problem when I found this.

julia> using Logging
WARNING: Method definition info(Any...) in module Base at util.jl:334 overwritten in module Logging at /Users/rory/.julia/v0.4/Logging/src/Logging.jl:61.
WARNING: Method definition warn(Any...) in module Base at util.jl:364 overwritten in module Logging at /Users/rory/.julia/v0.4/Logging/src/Logging.jl:61.

julia> Logging.configure(level=DEBUG)
Logger(root,DEBUG,Base.TTY(invalid status, 0 bytes waiting),root)

julia> Logging.info("blah")

signal (11): Segmentation fault: 11
uv_write2 at /Users/rory/.playground/src/julia-0.4_2015-11-30/Contents/Resources/julia/lib/julia/libjulia.dylib (unknown line)
uv_write at /Users/rory/.playground/src/julia-0.4_2015-11-30/Contents/Resources/julia/lib/julia/libjulia.dylib (unknown line)
jl_uv_write at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/jl_uv.c:358
uv_write at /Users/rory/.playground/src/julia-0.4_2015-11-30/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
buffer_or_write at /Users/rory/.playground/src/julia-0.4_2015-11-30/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
write at /Users/rory/.playground/src/julia-0.4_2015-11-30/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
print at /Users/rory/.playground/src/julia-0.4_2015-11-30/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
jlcall_print_19103 at /Users/rory/.playground/src/julia-0.4_2015-11-30/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia.h:1325
with_output_color at util.jl:316
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1691
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia.h:1325
print_with_color at util.jl:320
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1691
info at /Users/rory/.julia/v0.4/Logging/src/Logging.jl:53
info at /Users/rory/.julia/v0.4/Logging/src/Logging.jl:61
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1691
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:55
eval at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:213
jl_toplevel_eval_flex at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/toplevel.c:527
jl_toplevel_eval_in at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/builtins.c:579
eval_user_input at REPL.jl:62
jlcall_eval_user_input_21249 at  (unknown line)
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia.h:1325
anonymous at REPL.jl:92
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/task.c:241
fish: 'julia' terminated by signal SIGSEGV (Address boundary error)

I can confirm that is isn't related to some other packages I have installed as I tried this with a fresh package directory. Similarly, I've tested that this happens on both v0.4.0 and v0.4.1.

My temporary solution is to specify the output with:

julia> using Logging
WARNING: Method definition info(Any...) in module Base at util.jl:334 overwritten in module Logging at /Users/rory/.julia/v0.4/Logging/src/Logging.jl:61.
WARNING: Method definition warn(Any...) in module Base at util.jl:364 overwritten in module Logging at /Users/rory/.julia/v0.4/Logging/src/Logging.jl:61.

julia> Logging.configure(output=STDOUT, level=DEBUG)
Logger(root,DEBUG,Base.TTY(open, 0 bytes waiting),root)

julia> Logging.info("blah")
06-Dec 19:07:28:INFO:root:blah

Functionality in source that is not described in README.

By looking through the code I noticed this package has much more functionality than what is documented. Like how you can make several instances of the logger type and let them have parents, and how you can print to a log file with a specific logger etc.

Is that because of lack of time or because the other functions are not stable? They seemed to work fine for me.

Info about upcoming removal of packages in the General registry

As described in https://discourse.julialang.org/t/ann-plans-for-removing-packages-that-do-not-yet-support-1-0-from-the-general-registry/ we are planning on removing packages that do not support 1.0 from the General registry. This package has been detected to not support 1.0 and is thus slated to be removed. The removal of packages from the registry will happen approximately a month after this issue is open.

To transition to the new Pkg system using Project.toml, see https://github.com/JuliaRegistries/Registrator.jl#transitioning-from-require-to-projecttoml.
To then tag a new version of the package, see https://github.com/JuliaRegistries/Registrator.jl#via-the-github-app.

If you believe this package has erroneously been detected as not supporting 1.0 or have any other questions, don't hesitate to discuss it here or in the thread linked at the top of this post.

milliseconds

I would be nice to show the milliseconds (perhaps optionally) of when the log was emitted. We can do this using Date.jl's now() for Julia 0.3.

@Logging.configure throws error in Julia v0.6

When trying to use the logging macros:

julia> using Logging
julia> @Logging.configure(level=INFO)
ERROR: MethodError: no method matching override_info(::Logging.LogLevel)
Closest candidates are:
    override_info(; args...) at /home/vharisop/.julia/v0.6/Logging/src/Logging.jl:143
[vharisop@alwaysbored] julia -v
julia version 0.6.3

Overwriting Base.info and Base.warn

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?

test for Julia 0.6 failed

I get some error locally.

WARNING: Method definition warn(Any...) in module Base at util.jl:585 overwritten in module 
Logging at /usr/people/jingpeng/.julia/v0.6/Logging/src/Logging.jl:115.                     
WARNING: Method definition info(Any...) in module Base at util.jl:532 overwritten in module 
Logging at /usr/people/jingpeng/.julia/v0.6/Logging/src/Logging.jl:115.                     
ERROR: LoadError: LoadError: MethodError: no method matching override_info(::Logging.LogLeve
l)                                                                                          
Closest candidates are:                                                                     
  override_info(; args...) at /usr/people/jingpeng/.julia/v0.6/Logging/src/Logging.jl:143   
Stacktrace:                                                                                 
 [1] include_from_node1(::String) at ./loading.jl:576                                       
 [2] include(::String) at ./sysimg.jl:14                                                    
 [3] include_from_node1(::String) at ./loading.jl:576                                       
 [4] include(::String) at ./sysimg.jl:14                                                    
 [5] process_options(::Base.JLOptions) at ./client.jl:305                                   
 [6] _start() at ./client.jl:371                                                            

Namespace clash with Debug.jl

There's a namespace clash with Debug.jl (there may already have been before):

julia> using Logging

julia> @Logging.configure(level=INFO)
Logger(root,INFO,TTY(open, 0 bytes waiting),root)

julia> using Debug
Warning: using Debug.@debug in module Main conflicts with an existing identifier.

Don't use colors when writing to a file

When writing log entries to a file on disk, we shouldn't write console color escape sequences. Doing that reduces the ability to process the log file using automated tools.

Maybe this should become an option?

Instrumenting a module with logging

How do you suggest one instrument a module with logging? In the situation I have in mind, functions exported by the module call logging macros, but logging is turned off by default. Users should be able to enable logging in their own scripts if they want to. Something in the vein of

module SomeModule

export some_function;

using Logging
@Logging.configure(level=OFF)

function some_function()
  @debug("Run for cover!")
end
end

In the user's script,

using SomeModule
using Logging
my_logger = Logger("MyLogger")
Logging.configure(my_logger, level=DEBUG)
some_function()

I can't seem to find the intended syntax to achieve this.

Julia .4 Deprecated Base Classes

It looks like "Base.Foo" is being replaced by "AbstractFoo".

I might be able to work on this later today, but opening this for tracking.

Causes Segmentation fault: 11

It used to work great until this morning. Now all of a sudden, enabling any of the commented lines causes a seg fault

using Logging

# @Logging.configure(level=DEBUG)
# Logging.configure(level=DEBUG)

Error:

signal (11): Segmentation fault: 11 uv_write2 at /usr/local/Cellar/julia/0.4.2/lib/julia/libjulia.dylib (unknown line) jl_uv_write at /private/tmp/julia20151108-79873-1qly89w/src/jl_uv.c:358 uv_write at /usr/local/Cellar/julia/0.4.2/lib/julia/sys.dylib (unknown line) buffer_or_write at /usr/local/Cellar/julia/0.4.2/lib/julia/sys.dylib (unknown line) write at /usr/local/Cellar/julia/0.4.2/lib/julia/sys.dylib (unknown line) print at /usr/local/Cellar/julia/0.4.2/lib/julia/sys.dylib (unknown line) jlcall_print_19067 at /usr/local/Cellar/julia/0.4.2/lib/julia/sys.dylib (unknown line) with_output_color at util.jl:316 jl_apply at /private/tmp/julia20151108-79873-1qly89w/src/gf.c:1691 jl_apply at /private/tmp/julia20151108-79873-1qly89w/src/./julia.h:1325 print_with_color at util.jl:320 jl_apply at /private/tmp/julia20151108-79873-1qly89w/src/gf.c:1691 info at /Users/adrian/.julia/v0.4/Logging/src/Logging.jl:53 info at /Users/adrian/.julia/v0.4/Logging/src/Logging.jl:61 jl_apply at /private/tmp/julia20151108-79873-1qly89w/src/gf.c:1691 jl_apply at /private/tmp/julia20151108-79873-1qly89w/src/interpreter.c:55 eval at /private/tmp/julia20151108-79873-1qly89w/src/interpreter.c:213 jl_toplevel_eval_flex at /private/tmp/julia20151108-79873-1qly89w/src/toplevel.c:527 jl_toplevel_eval_in at /private/tmp/julia20151108-79873-1qly89w/src/builtins.c:579 log at /Users/adrian/Dropbox/Projects/jinnie/lib/Jinnie/src/logger.jl:3 req_logger at /Users/adrian/Dropbox/Projects/jinnie/lib/Jinnie/src/middlewares.jl:2 jl_apply at /private/tmp/julia20151108-79873-1qly89w/src/gf.c:1691 anonymous at /Users/adrian/.julia/v0.4/Mux/src/Mux.jl:8 toresponse at /Users/adrian/Dropbox/Projects/jinnie/lib/Mux/src/basics.jl:47 jl_apply at /private/tmp/julia20151108-79873-1qly89w/src/gf.c:1691 anonymous at /Users/adrian/Dropbox/Projects/jinnie/lib/Mux/src/Mux.jl:8 splitquery at /Users/adrian/Dropbox/Projects/jinnie/lib/Mux/src/basics.jl:28 jl_apply at /private/tmp/julia20151108-79873-1qly89w/src/gf.c:1691 anonymous at /Users/adrian/Dropbox/Projects/jinnie/lib/Mux/src/Mux.jl:8 basiccatch at /Users/adrian/Dropbox/Projects/jinnie/lib/Mux/src/basics.jl:68 jl_apply at /private/tmp/julia20151108-79873-1qly89w/src/gf.c:1691 anonymous at /Users/adrian/Dropbox/Projects/jinnie/lib/Mux/src/Mux.jl:8 todict at /Users/adrian/Dropbox/Projects/jinnie/lib/Mux/src/basics.jl:21 jl_apply at /private/tmp/julia20151108-79873-1qly89w/src/gf.c:1691 anonymous at /Users/adrian/Dropbox/Projects/jinnie/lib/Mux/src/Mux.jl:12 anonymous at /Users/adrian/Dropbox/Projects/jinnie/lib/Mux/src/Mux.jl:12 anonymous at /Users/adrian/Dropbox/Projects/jinnie/lib/Mux/src/Mux.jl:12 anonymous at /Users/adrian/.julia/v0.4/Mux/src/Mux.jl:8 anonymous at /Users/adrian/.julia/v0.4/Mux/src/server.jl:31 on_message_complete at /Users/adrian/.julia/v0.4/HttpServer/src/HttpServer.jl:400 jl_apply at /private/tmp/julia20151108-79873-1qly89w/src/gf.c:1691 on_message_complete at /Users/adrian/.julia/v0.4/HttpServer/src/RequestParser.jl:104 jlcapi_on_message_complete_21244 at (unknown line) http_parser_execute at /Users/adrian/.julia/v0.4/HttpParser/deps/usr/lib/libhttp_parser.dylib (unknown line) http_parser_execute at /Users/adrian/.julia/v0.4/HttpParser/src/HttpParser.jl:92 process_client at /Users/adrian/.julia/v0.4/HttpServer/src/HttpServer.jl:365 jlcall_process_client_21684 at (unknown line) jl_apply at /private/tmp/julia20151108-79873-1qly89w/src/gf.c:1691 anonymous at task.jl:447 jl_apply at /private/tmp/julia20151108-79873-1qly89w/src/./julia.h:1325

It's possible that the package was updated this morning, but the version not bumped? I'm on v0.2.0.

The reason I'm suggesting this is that it still runs if launched through DeclarativePackage (which uses a version of the packaged installed days ago).

Seg fault (v0.4 and v0.5)

I encountered a seg fault in v.0.5 (also in v.0.4) when I introduced Logging.jl - my set of tests runs fine without Logging, but crashes immediately when I try to log something:

signal (11): Segmentation fault: 11
while loading /Users/stefan/.julia/v0.5/Couchzilla/test/crud_tests.jl, in expression starting on line 1
uv_write2 at /Users/osx/buildbot/slave/package_osx10_9-x64/build/deps/srccache/libuv-8d5131b6c1595920dd30644cd1435b4f344b46c8/src/unix/stream.c:1389
uv_write at /Users/osx/buildbot/slave/package_osx10_9-x64/build/deps/srccache/libuv-8d5131b6c1595920dd30644cd1435b4f344b46c8/src/unix/stream.c:1475
jl_uv_write at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/jl_uv.c:424
uv_write at ./stream.jl:809
unsafe_write at ./stream.jl:830
write at ./io.jl:175
print at ./strings/io.jl:70 [inlined]
with_output_color at ./util.jl:302
jl_call_method_internal at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia_internal.h:189 [inlined]
jl_apply_generic at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1942
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia.h:1392 [inlined]
jl_f__apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/builtins.c:547
print_with_color at ./util.jl:306
jl_call_method_internal at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia_internal.h:189 [inlined]
jl_apply_generic at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1942
err at /Users/stefan/.julia/v0.5/Logging/src/Logging.jl:53

relax#2 at /Users/stefan/.julia/v0.5/Couchzilla/src/utils.jl:97

unknown function (ip: 0x318f98bb6)
jl_call_method_internal at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia_internal.h:189 [inlined]
jl_apply_generic at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1942

relax at ./:0

readdoc#6 at /Users/stefan/.julia/v0.5/Couchzilla/src/database.jl:177

readdoc at /Users/stefan/.julia/v0.5/Couchzilla/src/database.jl:126
unknown function (ip: 0x318f94f66)
jl_call_method_internal at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia_internal.h:189 [inlined]
jl_apply_generic at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1942
macro expansion; at /Users/stefan/.julia/v0.5/Couchzilla/test/crud_tests.jl:4 [inlined]
macro expansion; at ./test.jl:672 [inlined]
anonymous at ./ (unknown line)
unknown function (ip: 0x318f9484f)
jl_call_method_internal at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia_internal.h:189 [inlined]
jl_toplevel_eval_flex at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/toplevel.c:569
jl_parse_eval_all at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/ast.c:717
jl_load at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/toplevel.c:596 [inlined]
jl_load_ at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/toplevel.c:605
include_from_node1 at ./loading.jl:488
jlcall_include_from_node1_20125 at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
jl_call_method_internal at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia_internal.h:189 [inlined]
jl_apply_generic at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1942
do_call at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:66
eval at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:190
eval_body at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:534
eval_body at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:515
jl_interpret_call at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:573
jl_toplevel_eval_flex at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/toplevel.c:572
jl_parse_eval_all at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/ast.c:717
jl_load at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/toplevel.c:596 [inlined]
jl_load_ at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/toplevel.c:605
include_from_node1 at ./loading.jl:488
jlcall_include_from_node1_20125 at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
jl_call_method_internal at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia_internal.h:189 [inlined]
jl_apply_generic at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1942
process_options at ./client.jl:262
_start at ./client.jl:318
jlcall__start_21452 at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
jl_call_method_internal at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia_internal.h:189 [inlined]
jl_apply_generic at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1942
true_main at /usr/local/bin/julia (unknown line)
main at /usr/local/bin/julia (unknown line)
Allocations: 5977816 (Pool: 5976813; Big: 1003); GC: 8
./run.sh: line 8: 33854 Segmentation fault: 11 julia runtests.jl

join forces?

this PR to julia base provides built-in functionality similar to Logging.jl. would greatly appreciate your comments.

Using capitalized function names

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.

On Master: WARNING: both Logging and Base export "log"; uses of it in module Main must be qualified

julia> Pkg.checkout("Logging")
INFO: No packages to install, update or remove

julia> Pkg.status("Logging")
 - Logging                       0.2.0+             master

julia> using Logging
WARNING: Method definition info(Any...) in module Base at util.jl:320 overwritten in module Logging at /home/josh/.julia/v0.5/Logging/src/Logging.jl:104.
WARNING: Method definition warn(Any...) in module Base at util.jl:350 overwritten in module Logging at /home/josh/.julia/v0.5/Logging/src/Logging.jl:104.

julia> log
WARNING: both Logging and Base export "log"; uses of it in module Main must be qualified
ERROR: UndefVarError: log not defined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.