Source code for prettypython.text.trace
"""Format a trace message.
The default foreground color is gray, and bold styling is enabled
by default. Additional text styles can be configured with keyword
arguments.
Args:
text: The string to format.
**kwargs: Optional styling settings supported by the shared
styling engine, including ``bold``, ``underline``, ``italic``,
``dim``, ``reverse``, ``strikethrough``, ``color``, ``bg``,
and ``pure``. Unknown keyword arguments are ignored.
Returns:
str: The formatted string with ANSI escape sequences, or the
original string when ``pure=True``.
Raises:
TypeError: If ``text`` is not a string, or if ``color`` or ``bg``
has an invalid type.
ValueError: If a supplied foreground or background color name
is unsupported.
Example:
>>> from prettypython.text import trace
>>> trace("Example", pure=True)
'Example'
"""
from ._style import style
[docs]
def trace(text: str, **kwargs: object) -> str:
"""Format text using the default gray foreground."""
return style(text, "90", **kwargs)