Skip to content

Commit 18a6a0f

Browse files
committed
future julia compat for Core.BuiltinInts
1 parent 1e6a2de commit 18a6a0f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/runner/PlutoRunner.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2360,14 +2360,16 @@ function Logging.shouldlog(logger::PlutoCellLogger, level, _module, _...)
23602360
level == stdout_log_level
23612361
end
23622362

2363+
const BuiltinInts = @static isdefined(Core, :BuiltinInts) ? Core.BuiltinInts : Union{Bool, Int32, Int64, UInt32, UInt64, UInt8, Int128, Int16, Int8, UInt128, UInt16}
2364+
23632365
Logging.min_enabled_level(::PlutoCellLogger) = min(Logging.Debug, stdout_log_level)
23642366
Logging.catch_exceptions(::PlutoCellLogger) = false
23652367
function Logging.handle_message(pl::PlutoCellLogger, level, msg, _module, group, id, file, line; kwargs...)
23662368
# println("receiving msg from ", _module, " ", group, " ", id, " ", msg, " ", level, " ", line, " ", file)
23672369
# println("with types: ", "_module: ", typeof(_module), ", ", "msg: ", typeof(msg), ", ", "group: ", typeof(group), ", ", "id: ", typeof(id), ", ", "file: ", typeof(file), ", ", "line: ", typeof(line), ", ", "kwargs: ", typeof(kwargs)) # thanks Copilot
23682370

23692371
# https://github.com/JuliaLang/julia/blob/eb2e9687d0ac694d0aa25434b30396ee2cfa5cd3/stdlib/Logging/src/ConsoleLogger.jl#L110-L115
2370-
if get(kwargs, :maxlog, nothing) isa Core.BuiltinInts
2372+
if get(kwargs, :maxlog, nothing) isa BuiltinInts
23712373
maxlog = kwargs[:maxlog]
23722374
remaining = get!(pl.message_limits, id, Int(maxlog)::Int)
23732375
pl.message_limits[id] = remaining - 1

0 commit comments

Comments
 (0)