Skip to content

Add log.warning to basic_bot.commons.log #107

@littlebee

Description

@littlebee

If for no other reason than Claude being convinced that must be a log.warning() :)

Context

basic_bot.commons.log module currently provides .debug() and .info() and .error() messages. Showing of debug messages in the stdout are conditioned on being in "development" or "test" BB_ENV or if the BB_LOG_DEBUG is truthy

The only difference between .info and .error currently is the message prefix in the line output being "INFO: " and "ERROR: ".

The timestamps are intended to be sortable and easily readable.

Why are we not using the Python logging builtin? 🤷 I do have a reason, but it's mostly an ignorant one. I'll start with the proposition that logging should be dirt easy to use and configure, and, given that we live in a Docker container world, should by default direct its output to stdout and stderr where container management tools expect to look for application-level logging?

Task

  1. Just add a .warning() function for now with same timestamp format, a message prefix "WARN: "
  2. There is no need for conditional display; always show.
  3. use stdout

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions