Skip to main content

Bash colors management and log system

Project description

BASH UTILS

Bash colors management and log system

Bashutils provide you two functionnalities:

  • Create bash colored text

  • Log message system (like lsb init-functions log message)

Imports :

from bashutils import colors from bashutils import logmsg

bash colors

Color function : `color_text(text, color="none", bcolor="none", effect="none")`

  • color : text color

  • bcolor : background color

  • effect : font effect

Text and background colors list : none, black ,red ,green ,yellow ,blue ,magenta ,cyan ,white

default color is ‘none’ (terminal default color)

Text effects : none, bold, underscore, blink, reverse, concealed

default effect is ‘none’

bash logmsg

Start a new log message : ` log_begin_message("My message") `

End a log message : ` log_end_message(logmsg.LOG["OK"]) `

Log type : OK (0), FAIL (1), WARNING (2), ERROR (3)

Predefined message (begin and end message): ` log_success_msg("My message") log_failure_msg("My message") log_error_msg("My message") `

Predefined for all types : ` log_msg_type("My message", logmsg.LOG["OK"]) `

Add pre or post information on log message : ` log_msg_pre("SUPP") log_msg_post("SUPP") `

Add pre or post information on log message and end it : ` log_end_msg_pre("SUPP", logmsg.LOG["OK"]) log_end_msg_post("SUPP", logmsg.LOG["OK"]) `

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

Bashutils-0.0.2.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file Bashutils-0.0.2.tar.gz.

File metadata

  • Download URL: Bashutils-0.0.2.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Bashutils-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2812fafcb17bc4fcd0e3a76ddbf358b4b45a95ccb53b1de9e9f98cf4a3ee12a6
MD5 dcf9fcc6625b33d2e4268bd06c38c4a5
BLAKE2b-256 bab9b121a128b2e3f1c300bd3bb524980ee5900a361862cabdfda574136e77e2

See more details on using hashes here.

Supported by

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