python library for writing progress texts, echo messages, warnings and errors to standard output
Project description
screenwriter
Python Library for writing progress texts, echo messages, warnings and errors to standard output
Screenwriter
Use Screenwriter to prefix screen prints
Examples:
1 - Default prefix
from screenwriter import Screenwriter
sw = Screenwriter ()
sw.echo ('my output')
Output:
2019-07-26-11:16:04 my output
2 - Date Time parts in prefix
from screenwriter import Screenwriter
sw = Screenwriter ('%Y-%m-%d %H:%M:%S.%f ')
sw.echo ('my output')
Output:
2019-07-26 11:16:04 my output
3 - Error, Warning & Info standard prefixes
from screenwriter import Screenwriter
sw = Screenwriter ()
sw.error ('an error message')
sw.warn ('a warming message')
sw.info ('an informational message')
Output:
2019-07-29-11:39:00 ERROR: an error message
2019-07-29-11:39:00 WARN: a warming message
2019-07-29-11:39:00 INFO: an informational message
4 - Trimming content length
By default, log strings are trimmed to 1000 chars. You can change this setting:
from screenwriter import Screenwriter
sw = Screenwriter ()
sw.set_maxlen (80) #Set maximum length to 80
For format options, see http://strftime.org/
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
screenwriter-1.0.2.tar.gz
(1.9 kB
view hashes)
Built Distribution
Close
Hashes for screenwriter-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b06d7f60cfc1d4b297f544ccb332f6869b05529b8c4b795958e81e199552a08 |
|
MD5 | fb8fe0f5c15027d9135a99a25845276e |
|
BLAKE2b-256 | 8784e5a90bfe4ca96cd70e95baeae80cbb01df96b9c8d91b2a60433f946ad21f |