Skip to content

Sticky messages with subprocesses do not work well #22

@tkf

Description

@tkf

When writing JuliaCI/PkgBenchmark.jl#104, I realized that sticky messages do not work well with sub-processes. An example:

using Logging
using ProgressLogging
using TerminalLoggers

with_logger(TerminalLogger()) do
    @progress for _ in 1:10
        code = """
        using Logging
        using ProgressLogging
        using TerminalLoggers
        with_logger(TerminalLogger()) do
            @info "From child process" getpid()
            @progress for _ in 1:10
                sleep(0.01)
            end
        end
        """
        run(`julia --startup-file=no -e $code`)
    end
end

But I'm not sure if it's probably impossible to fix this in TerminalLoggers.jl. Maybe implementing some workarounds using an environment variable could be helpful.

Ultimate solution may be to merge log records from subprocesses to the main process using IPC-based logger "bridge" (which is way outside of the scope of TerminalLoggers.jl, I guess, though).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions