Skip to content

Commit

Permalink
spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
arabidopsis committed Dec 16, 2023
1 parent ce13c19 commit 8e95893
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions src/dist/ZMQLogger.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct ZMQLogger <: Logging.AbstractLogger
message_limits::Dict{Any,Int}
socket::ZMQ.Socket

function ZMQLogger(endpoint::String, min_level::Logging.LogLevel = Logging.Warn; topic::String = "", message_limits = nothing)
function ZMQLogger(endpoint::String, min_level::Logging.LogLevel=Logging.Warn; topic::String="", message_limits=nothing)
if message_limits === nothing
message_limits = Dict{Any,Int}()
end
Expand All @@ -42,7 +42,7 @@ struct ZMQLogger <: Logging.AbstractLogger
end

function Logging.handle_message(logger::ZMQLogger, level, message, _module, group, id,
filepath, line; maxlog = nothing, kwargs...)
filepath, line; maxlog=nothing, kwargs...)

if maxlog !== nothing && maxlog isa Integer
remaining = get!(logger.message_limits, id, maxlog)
Expand All @@ -53,8 +53,8 @@ function Logging.handle_message(logger::ZMQLogger, level, message, _module, grou
buf = IOBuffer()
io = IOContext(buf, stderr)
println(io, msglines[1])
for i in 2:length(msglines)
println(io, "\t> ", msglines[i])
for v in msglines[2:end]
println(io, "\t> ", v)
end
for (key, val) in kwargs
println(io, "\t> ", key, " = ", val)
Expand All @@ -70,8 +70,8 @@ function Logging.handle_message(logger::ZMQLogger, level, message, _module, grou
topic = "$(topic).$(task_id)"
end
# julia Strings are already utf-8: Vector{UInt8}(msg)
ZMQ.send(logger.socket, ZMQ.Message(topic); more = true)
ZMQ.send(logger.socket, ZMQ.Message(msg); more = false)
ZMQ.send(logger.socket, ZMQ.Message(topic); more=true)
ZMQ.send(logger.socket, ZMQ.Message(msg); more=false)
end
nothing
end
Expand All @@ -88,7 +88,7 @@ function Logging.catch_exceptions(logger::ZMQLogger)
end


function set_global_logger(level::String = "warn", endpoint::MayBeString = nothing; quiet::Bool = true, topic = "")
function set_global_logger(level::String="warn", endpoint::MayBeString=nothing; quiet::Bool=true, topic="")

# don't add any line number guff even for debugging
function quiet_metafmt(level, _module, group, id, file, line)
Expand All @@ -100,10 +100,10 @@ function set_global_logger(level::String = "warn", endpoint::MayBeString = nothi
llevel = get(LOGLEVELS, level, Logging.Warn)

if endpoint === nothing
logger = Logging.ConsoleLogger(stderr, llevel, meta_formatter = quiet ? quiet_metafmt : Logging.default_metafmt)
logger = Logging.ConsoleLogger(stderr, llevel, meta_formatter=quiet ? quiet_metafmt : Logging.default_metafmt)
else
logger = ZMQLogger(endpoint::String, llevel; topic = topic)
logger = ZMQLogger(endpoint::String, llevel; topic=topic)
end
Logging.global_logger(logger)
end
end # module
end # module
2 changes: 1 addition & 1 deletion src/dist/chloe_distributed.jl
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ function chloe_listen(address::String, broker::MayBeString=nothing,
try
rmprocs(procs, waitfor=20)
catch e
@warn "background processes took to long to exit $e"
@warn "background processes took too long to exit $e"
end
end

Expand Down
6 changes: 3 additions & 3 deletions src/dist/dist_globals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import Logging
const LOGLEVELS = Dict("info" => Logging.Info, "debug" => Logging.Debug, "warn" => Logging.Warn,
"error" => Logging.Error)

const ZMQ_WORKER = "tcp://127.0.0.1:9457"
const ZMQ_CLIENT = "ipc:///tmp/chloe2-client"
const ZMQ_BACKEND = "ipc:///tmp/chloe2-backend"
const ZMQ_WORKER = "tcp://127.0.0.1:9458"
const ZMQ_CLIENT = "ipc:///tmp/chloe4-client"
const ZMQ_BACKEND = "ipc:///tmp/chloe4-backend"
# change this if you change the API!
const VERSION = "4.0"

0 comments on commit 8e95893

Please sign in to comment.