+
Skip to content

[Feature Request] Use logging instead of raw printing to stdout/stderr #286

@jkrenzer

Description

@jkrenzer

Hi!

Currently svmbir prints to console all it's messages. This makes ist somewhat hacky to use inside other projects, which have a propper logging interface or a CLI.

There basically two options I would suggest going forward:

  1. Use a real logging library like python's loggingmodule and make use of the differen log levels to differentiate severity of messages
    • More effort needed as all print statements have to be evaluated and changed
    • But also more value gained as information of logging is differentiated better and the consumer can use level or location filters to filter messages he wants
  2. Replace print calls by a _print function which is defined in the svmbir module and defaults to _print = print
    • Less effort, can be basically done mostly by search and replace
    • Quite hacky
    • Not much value gained as consumer has to parse the printed messages to determine leves for logging and locating the message is not possible

Cheers,

Jörn

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载