Skip to content

1.11 showvalue is now in BaseCoreLogging #19

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

Merged
merged 3 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ uuid = "c41e01d8-14e5-11ea-185b-e7eabed7be4b"
keywords = ["log", "rotate", "roller", "logrotate"]
license = "MIT"
authors = ["Tanmay Mohapatra <[email protected]>"]
version = "0.5.0"
version = "0.5.1"

[compat]
julia = "1.8"
Expand Down
5 changes: 3 additions & 2 deletions src/LogRoller.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module LogRoller
using Dates
using Logging
using CodecZlib
using Logging
using JSON
using JSON.Serializations: CommonSerialization, StandardSerialization
using JSON.Writer: StructuralContext
Expand All @@ -16,6 +15,8 @@ export RollingLogger, RollingFileWriter, postrotate
const BUFFSIZE = 1024*16 # try and read 16K pages when possible
const DEFAULT_MAX_LOG_ENTRY_SIZE = 256*1024

const showvalue = VERSION ≥ v"1.11.0-DEV.1786" ? Base.CoreLogging.showvalue : Logging.showvalue

include("limitio.jl")
include("log_utils.jl")

Expand Down Expand Up @@ -223,7 +224,7 @@ function handle_message(logger::RollingLogger, level, message, _module, group, i
for (key, val) in kwargs
kwarg_timestamp && (key === logger.timestamp_identifier) && continue
print(iob, "│ ", key, " = ")
Logging.showvalue(iob, val)
showvalue(iob, val)
println(iob)
end
println(iob, "└ @ ", something(_module, "nothing"), " ", something(filepath, "nothing"), ":", something(line, "nothing"))
Expand Down
Loading