From f24c773223fe2d0fc5c0b4d16d6c6fb1ff2ce6c5 Mon Sep 17 00:00:00 2001 From: KristofferC Date: Fri, 10 May 2024 12:11:42 +0200 Subject: [PATCH] move ConsoleLogger into Base --- base/Base.jl | 10 ++++++---- {stdlib/Logging/src => base/logging}/ConsoleLogger.jl | 0 base/{ => logging}/logging.jl | 2 ++ base/meta.jl | 2 -- stdlib/Logging/src/Logging.jl | 8 +------- 5 files changed, 9 insertions(+), 13 deletions(-) rename {stdlib/Logging/src => base/logging}/ConsoleLogger.jl (100%) rename base/{ => logging}/logging.jl (99%) diff --git a/base/Base.jl b/base/Base.jl index 3b95b44a33f0b..d4f1b385c43dd 100644 --- a/base/Base.jl +++ b/base/Base.jl @@ -402,13 +402,13 @@ include("weakkeydict.jl") include("scopedvalues.jl") using .ScopedValues -# Logging -include("logging.jl") -using .CoreLogging - # metaprogramming include("meta.jl") +# Logging +include("logging/logging.jl") +using .CoreLogging + include("env.jl") # functions defined in Random @@ -634,6 +634,8 @@ function __init__() if get_bool_env("JULIA_USE_FLISP_PARSER", false) === false JuliaSyntax.enable_in_core!() end + + CoreLogging.global_logger(CoreLogging.ConsoleLogger()) nothing end diff --git a/stdlib/Logging/src/ConsoleLogger.jl b/base/logging/ConsoleLogger.jl similarity index 100% rename from stdlib/Logging/src/ConsoleLogger.jl rename to base/logging/ConsoleLogger.jl diff --git a/base/logging.jl b/base/logging/logging.jl similarity index 99% rename from base/logging.jl rename to base/logging/logging.jl index 75b8eea5051d2..7124ffe25abf2 100644 --- a/base/logging.jl +++ b/base/logging/logging.jl @@ -700,4 +700,6 @@ end _global_logstate = LogState(SimpleLogger()) +include("logging/ConsoleLogger.jl") + end # CoreLogging diff --git a/base/meta.jl b/base/meta.jl index bc07a7efa6c74..e648df29c12f9 100644 --- a/base/meta.jl +++ b/base/meta.jl @@ -5,8 +5,6 @@ Convenience functions for metaprogramming. """ module Meta -using ..CoreLogging - export quot, isexpr, isidentifier, diff --git a/stdlib/Logging/src/Logging.jl b/stdlib/Logging/src/Logging.jl index d6f41dd4242cf..72924e047a9ef 100644 --- a/stdlib/Logging/src/Logging.jl +++ b/stdlib/Logging/src/Logging.jl @@ -68,7 +68,7 @@ Alias for [`LogLevel(1_000_001)`](@ref LogLevel). const AboveMaxLevel = Base.CoreLogging.AboveMaxLevel using Base.CoreLogging: - closed_stream + closed_stream, ConsoleLogger, default_metafmt export AbstractLogger, @@ -92,8 +92,6 @@ export Error, AboveMaxLevel -include("ConsoleLogger.jl") - # The following are also part of the public API, but not exported: # # 1. Log levels: @@ -102,8 +100,4 @@ include("ConsoleLogger.jl") # 2. AbstractLogger message related functions: # handle_message, shouldlog, min_enabled_level, catch_exceptions, -function __init__() - global_logger(ConsoleLogger()) -end - end