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
Release history Release notifications | RSS feed
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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prcssr-1.0.0.tar.gz.
File metadata
- Download URL: prcssr-1.0.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94a3013d397b8a8b3ceb0458f6e56b6ea4d35c496d2d96a23ad853ad24c407be
|
|
| MD5 |
14bcea12b2258fd3fd1b5f224d8c5c9f
|
|
| BLAKE2b-256 |
492a32ccd998c1e00137df9e20ea3328a8f64a21557c1162d6599be010ec7938
|
File details
Details for the file prcssr-1.0.0-py3-none-any.whl.
File metadata
- Download URL: prcssr-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68f2c5fff2bbb1ade6f209a2801eb0342c4ee48d1ac2f7b2585ba990ea42cbb2
|
|
| MD5 |
4c32d580933e45db37999456eebf01cd
|
|
| BLAKE2b-256 |
c935bd36cde6822fa4da81fe5b167943de0e9c0b937ab793d256288d239ac1a0
|