Skip to content

A Python package that allows you to interact with the shell, while logging various metadata, statistics, and trace information.

License

Notifications You must be signed in to change notification settings

sandialabs/shell-logger

Repository files navigation

WARNING: This package is still in the process of being open sourced. Until that work is done and this banner is removed, don't expect anything documented here to be accurate.

Lines of code codecov CodeFactor CodeQL Conda Version Conda Downloads Continuous Integration Contributor Covenant GitHub contributors Documentation Status License Merged PRs OpenSSF Best Practices OpenSSF Scorecard Platforms pre-commit pre-commit.ci Status PyPI - Version PyPI - Downloads Python Version Ruff

shell-logger

The shell-logger Python package allows you to interact with the shell, while logging various metadata, statistics, and trace information. Any time you're tempted to write your own wrapper around things like subprocess.Popen() or subprocess.run(), consider using shell_logger.ShellLogger.log() instead. If you're familiar with the Unix script command, this is similar in principle, but with substantially more functionality. If you're familiar with Python's logging module, the motivation is similar, but this intends to capture what's happening in the shell rather than in Python itself.

Installation

To get up and running with shell-logger, simply:

python3 -m pip install shell-logger

Usage

Once the package is installed, you can simply

from shell_logger import ShellLogger
sl = ShellLogger("Title of Log File")
sl.log("Execute my first command in the shell.", "echo 'Hello World'")

For more detailed usage and API information, please see our documentation.

Where to Get Help

If you're having trouble with shell-logger, or just want to ask a question, head on over to our issue board. If a quick search doesn't yield what you're looking for, feel free to file an issue.

Contributing

If you're interested in contributing to the development of shell-logger, we'd love to have your help 😀 Check out our contributing guidelines for how to get started. Past contributors include:

License

See LICENSE.md.

Credits

Special thanks to the EMPIRE project for investing in the initial development of this tool, and the GMS project for serving as a second user and contributing to its clean-up.