Command-Line Interface

errortools ships two CLI entry points: python -m errortools for package information, and logger for emitting log messages from the shell.

Installation

Both commands become available after installing the package:

pip install errortools

errortools command

Display package metadata and run tests.

Usage

python -m errortools [OPTIONS]

Options

Option

Short

Description

--version

-v

Show version and exit

--copyrights

-c

Show copyright information

--author

-a

Show author name

--email

-e

Show author email

--license

-l

Show license type

--url

-u

Show project URL

--info

-i

Show all package information

--run-tests

Run the test suite using pytest

Examples

# Print version
$ python -m errortools -v
v3.1.2

# Print all metadata
$ python -m errortools -i
errortools vx.x.x
  errortools - a toolset for working with Python exceptions and warnings and logging.
  Author:    Evan Yang <quantbit@126.com>
  License:   MIT
  URL:       https://github.com/more-abc/errortools
  Copyright: Copyright 2026 (C) aiwonderland Evan Yang

# Run the test suite
$ errortools --run-tests
...

logger command

Emit a single log message from the command line using the errortools structured logger.

Usage

logger MESSAGE [OPTIONS]

Options

Option

Short

Description

--level

-l

Log level: trace, debug, info, success, warning, error, critical (default: info)

--output

-o

Output stream: stderr or stdout (default: stderr)

Examples

# Info-level message (default)
$ logger "Deployment complete"

# Error-level message
$ logger "Connection failed" -l error

# Write to stdout instead of stderr
$ logger "Build started" -l info -o stdout