subscript

subscript.detect_os(release_file=PosixPath('/etc/redhat-release'))

Detect operating system string in runtime, just use default if not found.

Return type:

str

subscript.getLogger(module_name='subscript')

Provides a unified logger for subscript scripts.

Scripts in subscript are encouraged to use logging.info() instead of print().

The logger name will typically be “subscript.prtvol2csv” for the command line tool prtvol2csv.

Subscript scripts can set the level of the entire logger, through the setLevel() function. The default level is WARNING. Subscript scripts typically accept a –verbose argparse option to set the log level to INFO, and a –debug option to set to

Logging output is split by logging levels (split between WARNING and ERROR) to stdout and stderr, each log occurs in only one of the streams. This deviates from Unix standard, but is accepted here because few to none subscript tool are meant to have their stdout piped into another application by default (some of them can, then the programmer and user must be careful with log levels).

Parameters:

module_name (str) – A suggested name for the logger, usually __name__ should be supplied

Returns:

A logger object

Submodules