Skip to main content

Command Execution with Logging

Project description

Description

Command Execution with Logging

Disclaimer

  • No sanitization is applied by prcssr
  • You are responsible to sanitize the input

Installation

pip install prcssr

Usage

From command line:

python -m prcssr -c CMD [-l LOG]

Option Short Type Default Description
--cmd -c String - The command
--log -l String prcssr.log Path to log file

Programmatically:

from prcssr.model.Processor import Processor

p = Processor("info.log")

p.process("type test.txt")

stdout = p.processGetStdOut("type test.txt")

for line in stdout.readlines():
    print(line)

Example

python -m prccsr -c "type test.txt" -l info.log

Creates info.log with the following content:

[1970-01-01 10:10:10,214] | INFO | prcssr started!
[1970-01-01 10:10:10,217] | INFO | ----------
[1970-01-01 10:10:10,219] | INFO | CMD: type .\LICENSE.md
[1970-01-01 10:10:10,224] | INFO | ----------
[1970-01-01 10:10:10,230] | INFO | # This is a test file for prccsr
[1970-01-01 10:10:10,241] | INFO | ----------

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prcssr-1.0.0.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

prcssr-1.0.0-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page