rez.utils.colorize
- class rez.utils.colorize.ColorizedStreamHandler(stream=None)[source]
Bases:
logging.StreamHandlerA stream handler for use with the Python logger.
This handler uses the Colorama module to style the log messages based on the rez configuration.
- STYLES
A mapping between the Python logger levels and a function that can be used to provide the appropriate styling.
- Type
- STYLES = {0: <function notset>, 10: <function debug>, 20: <function info>, 30: <function warning>, 40: <function error>, 50: <function critical>}
- emit(record)[source]
Emit a record.
If the stream associated with this handler provides tty then the record that is emitted with be formatted to include escape sequences for appropriate styling.
- property is_colorized
- property is_tty
Return true if the stream associated with this handler is a tty stream.
- Returns
bool
- class rez.utils.colorize.Printer(buf=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]
Bases:
object
- rez.utils.colorize.alias(str_)[source]
Return the string wrapped with the appropriate styling to display a tool alias. The styling will be determined based on the rez configuration.
- rez.utils.colorize.critical(str_)[source]
Return the string wrapped with the appropriate styling of a critical message. The styling will be determined based on the rez configuration.
- rez.utils.colorize.debug(str_)[source]
Return the string wrapped with the appropriate styling of a debug message. The styling will be determined based on the rez configuration.
- rez.utils.colorize.ephemeral(str_)[source]
Return the string wrapped with the appropriate styling to display an ephemeral package. The styling will be determined based on the rez configuration.
- rez.utils.colorize.error(str_)[source]
Return the string wrapped with the appropriate styling of an error message. The styling will be determined based on the rez configuration.
- rez.utils.colorize.heading(str_)[source]
Return the string wrapped with the appropriate styling of a heading message. The styling will be determined based on the rez configuration.
- rez.utils.colorize.implicit(str_)[source]
Return the string wrapped with the appropriate styling to display an implicit package. The styling will be determined based on the rez configuration.
- rez.utils.colorize.inactive(str_)[source]
Return the string wrapped with the appropriate styling to display something inactive.
Choices are grey, grey or grey.
- rez.utils.colorize.info(str_)[source]
Return the string wrapped with the appropriate styling of an info message. The styling will be determined based on the rez configuration.
- rez.utils.colorize.local(str_)[source]
Return the string wrapped with the appropriate styling to display a local package. The styling will be determined based on the rez configuration.
- rez.utils.colorize.notset(str_)[source]
Return the string wrapped with the appropriate escape sequences to remove all styling.
- rez.utils.colorize.stream_is_tty(stream)[source]
Return true if the stream is a tty stream.
- Returns
bool