Flavors

ictr comes with a set of standard message flavors to categorize your output.

Standard Flavors

Each flavor has a specific semantic meaning and default presentation (color and emoji).

>>> # General information
>>> ictr( 'note', address = 'doctest' )( 'Configuration loaded.' )
NOTE|  Configuration loaded.

>>> # Warnings
>>> ictr( 'monition', address = 'doctest' )( 'Disk space low.' )
MONITION|  Disk space low.

>>> # Errors
>>> ictr( 'error', address = 'doctest' )( 'Connection failed.' )
ERROR|  Connection failed.

>>> # Critical failures
>>> ictr( 'abort', address = 'doctest' )( 'System shutting down.' )
ABORT|  System shutting down.

>>> # Successful operations
>>> ictr( 'success', address = 'doctest' )( 'Build completed.' )
SUCCESS|  Build completed.

>>> # Future/Pending tasks
>>> ictr( 'future', address = 'doctest' )( 'TODO: Refactor this.' )
FUTURE|  TODO: Refactor this.

>>> # Tips/Advice
>>> ictr( 'advice', address = 'doctest' )( 'Try using --verbose for more info.' )
ADVICE|  Try using --verbose for more info.

Flavor Aliases

For convenience, single-letter aliases are available for all standard flavors:

  • n -> note

  • m -> monition

  • e -> error

  • a -> abort

  • s -> success

  • f -> future

  • v -> advice (advice/verbum)

>>> ictr( 'n', address = 'doctest' )( 'Note alias.' )
NOTE|  Note alias.
>>> ictr( 'e', address = 'doctest' )( 'Error alias.' )
ERROR|  Error alias.

Exception-Capturing Flavors

Some flavors are designed to capture and display exceptions automatically. These flavors have the suffix x.

  • errorx -> error with exception stack trace

  • abortx -> abort with exception stack trace

See the Exceptions example for detailed usage.