Skip to content

Use loguru for logging #13

@TaiSakuma

Description

@TaiSakuma

I tried to switch from the Python standard logging to loguru. But I will need to do more work to complete it. I am working on the branch loguru.

The loguru readme shows how to send logging messages to loguru sinks. In nextline, this method doesn't correctly show the location of logging messages created in spawned processes. The locations all become nextline.utils.multiprocessing_logging:95, which is where nextline collects logging messages created in spawned processes.

loguru doesn't read the locations from the log records. It determines the locations from the frames in the main process.

On the other hand, loguru does support multiprocessing.. But it doesn't collect logging messages in the main process. It processes logging messages in each sub-process.

Consequently, to use loguru in nextline, we need to disable MultiprocessingLogging and use InterceptHandler in each spawned process.

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