FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    logging

    module · ferroui-splat · v0.5.0

    module logging
    

    Logging (Splat.Logging): the logger interfaces, the loggers Splat ships, the log managers that hand out a logger per type, IEnableLogger and LogHost.

    Types

    Upstream passes the Type of the class that logs; the port passes the name of the type, as std::any::type_name gives it (&'static str). The generic forms (debug_for::<T>, ...) take the type as a type parameter.

    Formatting

    The generated overloads of upstream with one to ten arguments (Debug<TArgument>(string messageFormat, TArgument argument), ...) and the params object[] ones are one method each that takes std::fmt::Arguments, made with format_args!:

    logger.debug_args(format_args!("{} of {}", index, count));
    

    format_args! formats nothing: the arguments are formatted when the logger writes the message, so a method that checks the level first (the _args methods, as the allocation-free overloads of upstream do) formats only when the level is enabled. The format string is checked at compile time.

    Exceptions

    An exception is a &dyn std::error::Error, written with its Display.

    View source

    Contents

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.