Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Classes | Concepts | Enumerations | Functions
trace Namespace Reference

Classes

struct  BaseName
 Compile-time string wrapper for use as a non-type template parameter. More...
 
struct  FormattingOptions
 Configuration and formatting options for a trace module. More...
 
struct  TracingBaseClass
 CRTP tracing base class that emits messages with demangled type name. More...
 

Concepts

concept  MdspanLike
 Compatibility alias for mdspan-like values handled by trace formatting.
 
concept  HasFmtFormatter
 
concept  HasStdFormatter
 
concept  Container
 
concept  HasPresentationMdspanView
 

Enumerations

enum class  trace_format_context { normal , fatal }
 

Functions

void append_optional_parameters (uni20::presentation::styled_text &text, FormattingOptions const &opts, uni20::presentation::styled_text const &parameters, std::string_view style_kind, bool start_newline=false)
 
void append_parameter_separator (uni20::presentation::styled_text &text, FormattingOptions const &opts, std::string_view style_kind, bool start_newline)
 
void append_trace_location (uni20::presentation::styled_text &text, FormattingOptions const &opts, std::string_view label, std::string_view style_kind, const char *file, int line)
 
void append_trace_module_location (uni20::presentation::styled_text &text, FormattingOptions const &opts, std::string_view label, std::string_view style_kind, const char *module, const char *file, int line)
 
bool canFormatAsPresentationMatrix (const std::vector< std::vector< std::string > > &elems)
 
template<typename... Args>
void CheckCall (const char *cond, const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void CheckEqualCall (const char *a, const char *b, const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void CheckFloatingEqCall (const char *a, const char *b, std::int64_t ulps, const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void DebugCheckCall (const char *cond, const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void DebugCheckEqualCall (const char *a, const char *b, const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void DebugCheckFloatingEqCall (const char *a, const char *b, std::int64_t ulps, const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void DebugPreconditionCall (const char *cond, const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void DebugPreconditionEqualCall (const char *a, const char *b, const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void DebugPreconditionFloatingEqCall (const char *a, const char *b, std::int64_t ulps, const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void DebugTraceCall (const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void DebugTraceModuleCall (const char *module, const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void DebugTraceModuleStackCall (const char *module, const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void DebugTraceOnceCall (const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void DebugTraceStackCall (const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void DebugTraceStackOnceCall (const char *exprList, const char *file, int line, const Args &... args)
 
std::size_t displayWidth (std::string_view str, FormattingOptions const &opts)
 
std::size_t displayWidth (std::string_view str, uni20::presentation::output_policy const &policy)
 
template<typename... Args>
void ErrorCall (const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void ErrorIfCall (const char *cond, const char *exprList, const char *file, int line, const Args &... args)
 
template<class Error >
requires std::derived_from<std::remove_cvref_t<Error>, uni20::diagnostic_error> && detail::HasDiagnosticReport<Error>
uni20::presentation::styled_text format_diagnostic (Error const &error)
 Format a structured diagnostic using the active trace presentation policy.
 
template<class Error >
requires std::derived_from<std::remove_cvref_t<Error>, uni20::diagnostic_error> && detail::HasDiagnosticReport<Error>
uni20::presentation::styled_text format_diagnostic (Error const &error, uni20::presentation::output_policy const &policy)
 Format a structured diagnostic using its ADL presentation report and attached context.
 
template<MdspanLike MDS>
std::string format_mdspan_to_string (MDS const &mds, FormattingOptions const &opts)
 Format an mdspan-like value using trace scalar formatting and presentation tensor art.
 
std::string format_timestamp ()
 
std::string format_trace_prefix (FormattingOptions const &opts)
 
uni20::presentation::styled_text format_trace_prefix_text (FormattingOptions const &opts)
 
std::string formatContainerToString (const std::string &elem, FormattingOptions const &opts, size_t max_width=0)
 
std::string formatContainerToString (const std::string &elem, size_t max_width=0)
 
std::string formatContainerToString (const std::vector< std::string > &elems, FormattingOptions const &opts, size_t max_width=0)
 
std::string formatContainerToString (const std::vector< std::string > &elems, size_t max_width=0)
 
std::string formatContainerToString (const std::vector< std::vector< std::string > > &elems, FormattingOptions const &opts, size_t max_width=0)
 
std::string formatContainerToString (const std::vector< std::vector< std::string > > &elems, size_t max_width=0)
 
std::string formatContainerToStringImpl (const std::string &elem, uni20::presentation::output_policy const &policy, size_t max_width=0)
 
std::string formatContainerToStringImpl (const std::vector< std::string > &elems, uni20::presentation::output_policy const &policy, size_t max_width=0)
 
std::string formatContainerToStringImpl (const std::vector< std::vector< std::string > > &elems, uni20::presentation::output_policy const &policy, size_t max_width=0)
 
std::string formatItemString (const std::pair< std::string, bool > &name, const std::string &value, const FormattingOptions &opts, int available_width)
 
template<typename T >
std::string formatItemString (const std::pair< std::string, bool > &name, const std::vector< T > &values, const FormattingOptions &opts, int available_width)
 
std::string formatItemString (const std::pair< std::string, bool > &name, detail::TraceNameValue const &value, const FormattingOptions &opts, int available_width)
 
uni20::presentation::styled_text formatItemText (const std::pair< std::string, bool > &name, const std::string &value, const FormattingOptions &opts, int available_width)
 
template<typename T >
uni20::presentation::styled_text formatItemText (const std::pair< std::string, bool > &name, const std::vector< T > &values, const FormattingOptions &opts, int available_width)
 
uni20::presentation::styled_text formatItemText (const std::pair< std::string, bool > &name, detail::TraceNameValue const &value, const FormattingOptions &opts, int available_width)
 
template<uni20::presentation::mdspan_like MDS>
std::string formatMdspanForTrace (MDS const &mds, FormattingOptions const &opts, int value_width, trace_format_context context, std::string_view label)
 
template<typename... Args>
std::string formatParameterList (const char *exprList, const FormattingOptions &opts, const Args &... args)
 
template<typename... Args>
uni20::presentation::styled_text formatParameterListText (const char *exprList, const FormattingOptions &opts, const Args &... args)
 
template<typename... Args>
uni20::presentation::styled_text formatParameterListTextForContext (const char *exprList, const FormattingOptions &opts, trace_format_context context, const Args &... args)
 
std::string formatParameters (std::vector< std::pair< std::string, bool > >::const_iterator b, const FormattingOptions &opts)
 
template<typename T , typename... Ts>
std::string formatParameters (std::vector< std::pair< std::string, bool > >::const_iterator b, const FormattingOptions &opts, const T &first, const Ts &... rest)
 
uni20::presentation::styled_text formatParametersText (std::vector< std::pair< std::string, bool > >::const_iterator b, const FormattingOptions &opts)
 
template<typename T , typename... Ts>
uni20::presentation::styled_text formatParametersText (std::vector< std::pair< std::string, bool > >::const_iterator b, const FormattingOptions &opts, const T &first, const Ts &... rest)
 
uni20::presentation::styled_text formatParametersTextForContext (std::vector< std::pair< std::string, bool > >::const_iterator b, const FormattingOptions &opts, trace_format_context context)
 
template<typename T , typename... Ts>
uni20::presentation::styled_text formatParametersTextForContext (std::vector< std::pair< std::string, bool > >::const_iterator b, const FormattingOptions &opts, trace_format_context context, const T &first, const Ts &... rest)
 
std::string formatRectangularContainerAsPresentationMatrix (const std::vector< std::vector< std::string > > &elems, FormattingOptions const &opts)
 
std::string formatValue (char *s, FormattingOptions const &opts)
 Format a mutable C‐string.
 
std::string formatValue (const char *s, FormattingOptions const &)
 Format a C‐string (null‐terminated) as a normal string.
 
template<Container ContainerType>
auto formatValue (const ContainerType &c, FormattingOptions const &opts) -> std::vector< decltype(formatValue(*std::begin(c), opts))>
 Format each element of a container by recursively calling formatValue.
 
template<typename Promise >
std::string formatValue (const std::coroutine_handle< Promise > &h, FormattingOptions const &)
 
std::string formatValue (const std::coroutine_handle<> &h, FormattingOptions const &)
 
template<typename T >
requires (!Container<T> && !HasFmtFormatter<T> && HasStdFormatter<T> && !uni20::RealOrComplex<T>)
std::string formatValue (const T &value, FormattingOptions const &)
 
template<typename T >
requires (!Container<T> && HasFmtFormatter<T> && !uni20::RealOrComplex<T>)
std::string formatValue (const T &value, FormattingOptions const &opts)
 Format a non-container, non-Uni20-scalar type with an fmt formatter.
 
detail::TraceNameValue formatValue (detail::TraceNameValue const &nv, FormattingOptions const &opts)
 special case for detail::TraceNameValue to return the pre-formatted name,value pair
 
template<uni20::presentation::mdspan_like MDS>
std::string formatValue (MDS const &mds, FormattingOptions const &opts)
 Format an mdspan-like value as presentation-layer tensor art.
 
std::string formatValue (std::string_view s, FormattingOptions const &)
 Format a C‐string (null‐terminated) as a normal string.
 
template<uni20::Complex T>
requires uni20::Real<uni20::make_real_t<T>>
std::string formatValue (T const &value, FormattingOptions const &opts)
 Format any Uni20 complex scalar using its real type's trace precision.
 
template<HasPresentationMdspanView T>
std::string formatValue (T const &value, FormattingOptions const &opts)
 Format tensor/view-like values through their mdspan view.
 
template<uni20::Real T>
std::string formatValue (T value, FormattingOptions const &opts)
 Format any Uni20 real scalar using its configured trace precision.
 
template<typename U >
requires (!std::is_same_v<U, char> && !std::is_same_v<U, const char>)
std::string formatValue (U *ptr, FormattingOptions const &)
 Format any non‐character pointer by showing its pointee type and address.
 
template<uni20::presentation::mdspan_like MDS>
std::string formatValueForContext (MDS const &mds, FormattingOptions const &opts, int value_width, trace_format_context context, std::string_view label)
 
template<HasPresentationMdspanView T>
std::string formatValueForContext (T const &value, FormattingOptions const &opts, int value_width, trace_format_context context, std::string_view label)
 
template<typename T >
auto formatValueForContext (T const &value, FormattingOptions const &opts, int, trace_format_context, std::string_view)
 
FormattingOptions & get_formatting_options (const std::string &module="")
 get the FormattingOptions object for a given module; use "" as the module name (or default parameter) for the global format
 
int getMaxLineWidth (const std::string &str)
 
std::size_t getMaxLineWidth (const std::string &str, uni20::presentation::output_policy const &policy)
 
bool isMultiline (const std::string &str)
 
template<typename T >
bool isMultiline (const std::vector< T > &str)
 
size_t maxWidth (const std::string &str)
 
size_t maxWidth (const std::string &str, uni20::presentation::output_policy const &policy)
 
template<typename T >
size_t maxWidth (const std::vector< T > &elems)
 
template<typename T >
size_t maxWidth (const std::vector< T > &elems, uni20::presentation::output_policy const &policy)
 
template<typename... Args>
void PanicCall (const char *exprList, const char *file, int line, const Args &... args)
 
std::vector< std::pair< std::string, bool > > parseNames (std::string_view s)
 
template<typename... Args>
void PreconditionCall (const char *cond, const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void PreconditionEqualCall (const char *a, const char *b, const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void PreconditionFloatingEqCall (const char *a, const char *b, std::int64_t ulps, const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void print (fmt::format_string< Args... > fmt_str, Args &&... args)
 Print formatted string via the default (empty-module) sink.
 
template<class Exception >
requires std::derived_from<std::remove_cvref_t<Exception>, std::exception>
void raise (Exception &&exception, std::source_location where=std::source_location::current())
 Raise a concrete exception through Uni20's configured error boundary.
 
bool should_show_thread_id (FormattingOptions const &opts)
 
template<typename... Args>
void TraceCall (const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void TraceModuleCall (const char *module, const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void TraceModuleStackCall (const char *module, const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void TraceOnceCall (const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void TraceStackCall (const char *exprList, const char *file, int line, const Args &... args)
 
template<typename... Args>
void TraceStackOnceCall (const char *exprList, const char *file, int line, const Args &... args)
 
std::string trim (const std::string &s)
 

Enumeration Type Documentation

◆ trace_format_context

enum class trace::trace_format_context
strong
Enumerator
normal 
fatal 

Function Documentation

◆ append_optional_parameters()

void trace::append_optional_parameters ( uni20::presentation::styled_text &  text,
FormattingOptions const &  opts,
uni20::presentation::styled_text const &  parameters,
std::string_view  style_kind,
bool  start_newline = false 
)
inline

◆ append_parameter_separator()

void trace::append_parameter_separator ( uni20::presentation::styled_text &  text,
FormattingOptions const &  opts,
std::string_view  style_kind,
bool  start_newline 
)
inline

◆ append_trace_location()

void trace::append_trace_location ( uni20::presentation::styled_text &  text,
FormattingOptions const &  opts,
std::string_view  label,
std::string_view  style_kind,
const char *  file,
int  line 
)
inline

◆ append_trace_module_location()

void trace::append_trace_module_location ( uni20::presentation::styled_text &  text,
FormattingOptions const &  opts,
std::string_view  label,
std::string_view  style_kind,
const char *  module,
const char *  file,
int  line 
)
inline

◆ canFormatAsPresentationMatrix()

bool trace::canFormatAsPresentationMatrix ( const std::vector< std::vector< std::string > > &  elems)
inline

◆ CheckCall()

template<typename... Args>
void trace::CheckCall ( const char *  cond,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ CheckEqualCall()

template<typename... Args>
void trace::CheckEqualCall ( const char *  a,
const char *  b,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ CheckFloatingEqCall()

template<typename... Args>
void trace::CheckFloatingEqCall ( const char *  a,
const char *  b,
std::int64_t  ulps,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ DebugCheckCall()

template<typename... Args>
void trace::DebugCheckCall ( const char *  cond,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ DebugCheckEqualCall()

template<typename... Args>
void trace::DebugCheckEqualCall ( const char *  a,
const char *  b,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ DebugCheckFloatingEqCall()

template<typename... Args>
void trace::DebugCheckFloatingEqCall ( const char *  a,
const char *  b,
std::int64_t  ulps,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ DebugPreconditionCall()

template<typename... Args>
void trace::DebugPreconditionCall ( const char *  cond,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ DebugPreconditionEqualCall()

template<typename... Args>
void trace::DebugPreconditionEqualCall ( const char *  a,
const char *  b,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ DebugPreconditionFloatingEqCall()

template<typename... Args>
void trace::DebugPreconditionFloatingEqCall ( const char *  a,
const char *  b,
std::int64_t  ulps,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ DebugTraceCall()

template<typename... Args>
void trace::DebugTraceCall ( const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ DebugTraceModuleCall()

template<typename... Args>
void trace::DebugTraceModuleCall ( const char *  module,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ DebugTraceModuleStackCall()

template<typename... Args>
void trace::DebugTraceModuleStackCall ( const char *  module,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ DebugTraceOnceCall()

template<typename... Args>
void trace::DebugTraceOnceCall ( const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ DebugTraceStackCall()

template<typename... Args>
void trace::DebugTraceStackCall ( const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ DebugTraceStackOnceCall()

template<typename... Args>
void trace::DebugTraceStackOnceCall ( const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ displayWidth() [1/2]

std::size_t trace::displayWidth ( std::string_view  str,
FormattingOptions const &  opts 
)
inline

◆ displayWidth() [2/2]

std::size_t trace::displayWidth ( std::string_view  str,
uni20::presentation::output_policy const &  policy 
)
inline

◆ ErrorCall()

template<typename... Args>
void trace::ErrorCall ( const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ ErrorIfCall()

template<typename... Args>
void trace::ErrorIfCall ( const char *  cond,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ format_diagnostic() [1/2]

template<class Error >
requires std::derived_from<std::remove_cvref_t<Error>, uni20::diagnostic_error> && detail::HasDiagnosticReport<Error>
uni20::presentation::styled_text trace::format_diagnostic ( Error const &  error)

Format a structured diagnostic using the active trace presentation policy.

Template Parameters
ErrorConcrete diagnostic exception type with a diagnostic_report customization.
Parameters
errorError whose report, source location, and stacktrace are formatted.
Returns
Styled diagnostic document wrapped to the configured terminal width.

◆ format_diagnostic() [2/2]

template<class Error >
requires std::derived_from<std::remove_cvref_t<Error>, uni20::diagnostic_error> && detail::HasDiagnosticReport<Error>
uni20::presentation::styled_text trace::format_diagnostic ( Error const &  error,
uni20::presentation::output_policy const &  policy 
)

Format a structured diagnostic using its ADL presentation report and attached context.

Template Parameters
ErrorConcrete diagnostic exception type with a diagnostic_report customization.
Parameters
errorError whose report, source location, and stacktrace are formatted.
policyPresentation policy controlling report layout and stacktrace wrapping.
Returns
Styled diagnostic document ready for terminal or plain rendering.

◆ format_mdspan_to_string()

template<MdspanLike MDS>
std::string trace::format_mdspan_to_string ( MDS const &  mds,
FormattingOptions const &  opts 
)

Format an mdspan-like value using trace scalar formatting and presentation tensor art.

Template Parameters
MDSMdspan-like object type.
Parameters
mdsMdspan-like object to render.
optsTrace formatting options.
Returns
Display-cell-aligned matrix or higher-order tensor art.

◆ format_timestamp()

std::string trace::format_timestamp ( )
inline

◆ format_trace_prefix()

std::string trace::format_trace_prefix ( FormattingOptions const &  opts)
inline

◆ format_trace_prefix_text()

uni20::presentation::styled_text trace::format_trace_prefix_text ( FormattingOptions const &  opts)
inline

◆ formatContainerToString() [1/6]

std::string trace::formatContainerToString ( const std::string &  elem,
FormattingOptions const &  opts,
size_t  max_width = 0 
)
inline

◆ formatContainerToString() [2/6]

std::string trace::formatContainerToString ( const std::string &  elem,
size_t  max_width = 0 
)
inline

◆ formatContainerToString() [3/6]

std::string trace::formatContainerToString ( const std::vector< std::string > &  elems,
FormattingOptions const &  opts,
size_t  max_width = 0 
)
inline

◆ formatContainerToString() [4/6]

std::string trace::formatContainerToString ( const std::vector< std::string > &  elems,
size_t  max_width = 0 
)
inline

◆ formatContainerToString() [5/6]

std::string trace::formatContainerToString ( const std::vector< std::vector< std::string > > &  elems,
FormattingOptions const &  opts,
size_t  max_width = 0 
)
inline

◆ formatContainerToString() [6/6]

std::string trace::formatContainerToString ( const std::vector< std::vector< std::string > > &  elems,
size_t  max_width = 0 
)
inline

◆ formatContainerToStringImpl() [1/3]

std::string trace::formatContainerToStringImpl ( const std::string &  elem,
uni20::presentation::output_policy const &  policy,
size_t  max_width = 0 
)
inline

◆ formatContainerToStringImpl() [2/3]

std::string trace::formatContainerToStringImpl ( const std::vector< std::string > &  elems,
uni20::presentation::output_policy const &  policy,
size_t  max_width = 0 
)
inline

◆ formatContainerToStringImpl() [3/3]

std::string trace::formatContainerToStringImpl ( const std::vector< std::vector< std::string > > &  elems,
uni20::presentation::output_policy const &  policy,
size_t  max_width = 0 
)
inline

◆ formatItemString() [1/3]

std::string trace::formatItemString ( const std::pair< std::string, bool > &  name,
const std::string &  value,
const FormattingOptions &  opts,
int  available_width 
)
inline

◆ formatItemString() [2/3]

template<typename T >
std::string trace::formatItemString ( const std::pair< std::string, bool > &  name,
const std::vector< T > &  values,
const FormattingOptions &  opts,
int  available_width 
)

◆ formatItemString() [3/3]

std::string trace::formatItemString ( const std::pair< std::string, bool > &  name,
detail::TraceNameValue const &  value,
const FormattingOptions &  opts,
int  available_width 
)
inline

◆ formatItemText() [1/3]

uni20::presentation::styled_text trace::formatItemText ( const std::pair< std::string, bool > &  name,
const std::string &  value,
const FormattingOptions &  opts,
int  available_width 
)
inline

◆ formatItemText() [2/3]

template<typename T >
uni20::presentation::styled_text trace::formatItemText ( const std::pair< std::string, bool > &  name,
const std::vector< T > &  values,
const FormattingOptions &  opts,
int  available_width 
)

◆ formatItemText() [3/3]

uni20::presentation::styled_text trace::formatItemText ( const std::pair< std::string, bool > &  name,
detail::TraceNameValue const &  value,
const FormattingOptions &  opts,
int  available_width 
)
inline

◆ formatMdspanForTrace()

std::string trace::formatMdspanForTrace ( MDS const &  mds,
FormattingOptions const &  opts,
int  value_width,
trace_format_context  context,
std::string_view  label 
)
inline

◆ formatParameterList()

template<typename... Args>
std::string trace::formatParameterList ( const char *  exprList,
const FormattingOptions &  opts,
const Args &...  args 
)

◆ formatParameterListText()

template<typename... Args>
uni20::presentation::styled_text trace::formatParameterListText ( const char *  exprList,
const FormattingOptions &  opts,
const Args &...  args 
)

◆ formatParameterListTextForContext()

template<typename... Args>
uni20::presentation::styled_text trace::formatParameterListTextForContext ( const char *  exprList,
const FormattingOptions &  opts,
trace_format_context  context,
const Args &...  args 
)

◆ formatParameters() [1/2]

std::string trace::formatParameters ( std::vector< std::pair< std::string, bool > >::const_iterator  b,
const FormattingOptions &  opts 
)
inline

◆ formatParameters() [2/2]

template<typename T , typename... Ts>
std::string trace::formatParameters ( std::vector< std::pair< std::string, bool > >::const_iterator  b,
const FormattingOptions &  opts,
const T &  first,
const Ts &...  rest 
)

◆ formatParametersText() [1/2]

uni20::presentation::styled_text trace::formatParametersText ( std::vector< std::pair< std::string, bool > >::const_iterator  b,
const FormattingOptions &  opts 
)
inline

◆ formatParametersText() [2/2]

template<typename T , typename... Ts>
uni20::presentation::styled_text trace::formatParametersText ( std::vector< std::pair< std::string, bool > >::const_iterator  b,
const FormattingOptions &  opts,
const T &  first,
const Ts &...  rest 
)

◆ formatParametersTextForContext() [1/2]

uni20::presentation::styled_text trace::formatParametersTextForContext ( std::vector< std::pair< std::string, bool > >::const_iterator  b,
const FormattingOptions &  opts,
trace_format_context  context 
)
inline

◆ formatParametersTextForContext() [2/2]

template<typename T , typename... Ts>
uni20::presentation::styled_text trace::formatParametersTextForContext ( std::vector< std::pair< std::string, bool > >::const_iterator  b,
const FormattingOptions &  opts,
trace_format_context  context,
const T &  first,
const Ts &...  rest 
)

◆ formatRectangularContainerAsPresentationMatrix()

std::string trace::formatRectangularContainerAsPresentationMatrix ( const std::vector< std::vector< std::string > > &  elems,
FormattingOptions const &  opts 
)
inline

◆ formatValue() [1/14]

std::string trace::formatValue ( char *  s,
FormattingOptions const &  opts 
)
inline

Format a mutable C‐string.

Delegates to the const char* overload.

Parameters
sPointer to a null‐terminated character array.
optsFormatting options.
Returns
The contents of the string, or "(null)" if s==nullptr.

◆ formatValue() [2/14]

std::string trace::formatValue ( const char *  s,
FormattingOptions const &   
)
inline

Format a C‐string (null‐terminated) as a normal string.

Parameters
sPointer to a null‐terminated character array.
optsFormatting options (unused here).
Returns
The contents of the string, or "(null)" if s==nullptr.

◆ formatValue() [3/14]

template<Container ContainerType>
auto trace::formatValue ( const ContainerType &  c,
FormattingOptions const &  opts 
) -> std::vector<decltype(formatValue(*std::begin(c), opts))>

Format each element of a container by recursively calling formatValue.

Template Parameters
ContainerTypeAny container with std::begin/std::end.
Parameters
cThe container whose elements to format.
optsFormatting options forwarded to each element call.
Returns
A std::vector<std::string> of the formatted elements.

◆ formatValue() [4/14]

template<typename Promise >
std::string trace::formatValue ( const std::coroutine_handle< Promise > &  h,
FormattingOptions const &   
)
inline

◆ formatValue() [5/14]

std::string trace::formatValue ( const std::coroutine_handle<> &  h,
FormattingOptions const &   
)
inline

◆ formatValue() [6/14]

template<typename T >
requires (!Container<T> && !HasFmtFormatter<T> && HasStdFormatter<T> && !uni20::RealOrComplex<T>)
std::string trace::formatValue ( const T &  value,
FormattingOptions const &   
)

◆ formatValue() [7/14]

template<typename T >
requires (!Container<T> && HasFmtFormatter<T> && !uni20::RealOrComplex<T>)
std::string trace::formatValue ( const T &  value,
FormattingOptions const &  opts 
)

Format a non-container, non-Uni20-scalar type with an fmt formatter.

Template Parameters
TType with an fmt::formatter specialization.
Parameters
valueValue to format.
optsFormatting options (unused by this overload).
Returns
The string produced by fmt::format("{}", value).

◆ formatValue() [8/14]

detail::TraceNameValue trace::formatValue ( detail::TraceNameValue const &  nv,
FormattingOptions const &  opts 
)
inline

special case for detail::TraceNameValue to return the pre-formatted name,value pair

◆ formatValue() [9/14]

std::string trace::formatValue ( MDS const &  mds,
FormattingOptions const &  opts 
)
inline

Format an mdspan-like value as presentation-layer tensor art.

Template Parameters
MDSMdspan-like object type.
Parameters
mdsMdspan-like object to render.
optsTrace formatting options, including presentation policy and scalar precision.
Returns
Display-cell-aligned matrix or higher-order tensor art.

◆ formatValue() [10/14]

std::string trace::formatValue ( std::string_view  s,
FormattingOptions const &   
)
inline

Format a C‐string (null‐terminated) as a normal string.

Parameters
sPointer to a null‐terminated character array.
optsFormatting options (unused here).
Returns
The contents of the string, or "(null)" if s==nullptr.

◆ formatValue() [11/14]

std::string trace::formatValue ( T const &  value,
FormattingOptions const &  opts 
)
inline

Format any Uni20 complex scalar using its real type's trace precision.

Template Parameters
TUni20 complex scalar type.
Parameters
valueComplex value to format.
optsTrace numeric formatting options.
Returns
Formatted complex value.

◆ formatValue() [12/14]

template<HasPresentationMdspanView T>
std::string trace::formatValue ( T const &  value,
FormattingOptions const &  opts 
)
inline

Format tensor/view-like values through their mdspan view.

Template Parameters
TObject type exposing mdspan().
Parameters
valueTensor or tensor view object to render.
optsTrace formatting options.
Returns
Display-cell-aligned matrix or higher-order tensor art.

◆ formatValue() [13/14]

template<uni20::Real T>
std::string trace::formatValue ( T  value,
FormattingOptions const &  opts 
)
inline

Format any Uni20 real scalar using its configured trace precision.

Template Parameters
TUni20 real scalar type, including configured extension types.
Parameters
valueReal value to format.
optsTrace numeric formatting options.
Returns
Formatted real value.

◆ formatValue() [14/14]

template<typename U >
requires (!std::is_same_v<U, char> && !std::is_same_v<U, const char>)
std::string trace::formatValue ( U *  ptr,
FormattingOptions const &   
)
inline

Format any non‐character pointer by showing its pointee type and address.

Template Parameters
UThe pointee type.
Parameters
ptrPointer to format.
optsFormatting options (unused here). \requires U is not char or const char.
Returns
A string like "MyType* @ 0x7fffdeadbeef".

◆ formatValueForContext() [1/3]

std::string trace::formatValueForContext ( MDS const &  mds,
FormattingOptions const &  opts,
int  value_width,
trace_format_context  context,
std::string_view  label 
)
inline

◆ formatValueForContext() [2/3]

template<HasPresentationMdspanView T>
std::string trace::formatValueForContext ( T const &  value,
FormattingOptions const &  opts,
int  value_width,
trace_format_context  context,
std::string_view  label 
)
inline

◆ formatValueForContext() [3/3]

template<typename T >
auto trace::formatValueForContext ( T const &  value,
FormattingOptions const &  opts,
int  ,
trace_format_context  ,
std::string_view   
)

◆ get_formatting_options()

FormattingOptions & trace::get_formatting_options ( const std::string &  module)
inline

get the FormattingOptions object for a given module; use "" as the module name (or default parameter) for the global format

Returns the FormattingOptions for a module, or the “default” when called with no args.

Empty module name ⇒ use the no-arg ctor (global defaults only).

◆ getMaxLineWidth() [1/2]

int trace::getMaxLineWidth ( const std::string &  str)
inline

◆ getMaxLineWidth() [2/2]

std::size_t trace::getMaxLineWidth ( const std::string &  str,
uni20::presentation::output_policy const &  policy 
)
inline

◆ isMultiline() [1/2]

bool trace::isMultiline ( const std::string &  str)
inline

◆ isMultiline() [2/2]

template<typename T >
bool trace::isMultiline ( const std::vector< T > &  str)

◆ maxWidth() [1/4]

size_t trace::maxWidth ( const std::string &  str)
inline

◆ maxWidth() [2/4]

size_t trace::maxWidth ( const std::string &  str,
uni20::presentation::output_policy const &  policy 
)
inline

◆ maxWidth() [3/4]

template<typename T >
size_t trace::maxWidth ( const std::vector< T > &  elems)

◆ maxWidth() [4/4]

template<typename T >
size_t trace::maxWidth ( const std::vector< T > &  elems,
uni20::presentation::output_policy const &  policy 
)

◆ PanicCall()

template<typename... Args>
void trace::PanicCall ( const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ parseNames()

std::vector< std::pair< std::string, bool > > trace::parseNames ( std::string_view  s)
inline

◆ PreconditionCall()

template<typename... Args>
void trace::PreconditionCall ( const char *  cond,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ PreconditionEqualCall()

template<typename... Args>
void trace::PreconditionEqualCall ( const char *  a,
const char *  b,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ PreconditionFloatingEqCall()

template<typename... Args>
void trace::PreconditionFloatingEqCall ( const char *  a,
const char *  b,
std::int64_t  ulps,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ print()

template<typename... Args>
void trace::print ( fmt::format_string< Args... >  fmt_str,
Args &&...  args 
)

Print formatted string via the default (empty-module) sink.

◆ raise()

template<class Exception >
requires std::derived_from<std::remove_cvref_t<Exception>, std::exception>
void trace::raise ( Exception &&  exception,
std::source_location  where = std::source_location::current() 
)

Raise a concrete exception through Uni20's configured error boundary.

Throw mode preserves the concrete exception type. Abort mode renders its presentation report, when available, and emits a stacktrace.

Template Parameters
ExceptionType derived from std::exception.
Parameters
exceptionException object to enrich and raise.
whereSource location at which the error is raised.

◆ should_show_thread_id()

bool trace::should_show_thread_id ( FormattingOptions const &  opts)
inline

◆ TraceCall()

template<typename... Args>
void trace::TraceCall ( const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ TraceModuleCall()

template<typename... Args>
void trace::TraceModuleCall ( const char *  module,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ TraceModuleStackCall()

template<typename... Args>
void trace::TraceModuleStackCall ( const char *  module,
const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ TraceOnceCall()

template<typename... Args>
void trace::TraceOnceCall ( const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ TraceStackCall()

template<typename... Args>
void trace::TraceStackCall ( const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ TraceStackOnceCall()

template<typename... Args>
void trace::TraceStackOnceCall ( const char *  exprList,
const char *  file,
int  line,
const Args &...  args 
)

◆ trim()

std::string trace::trim ( const std::string &  s)
inline