Struct godot_logger::Builder[][src]

pub struct Builder { /* fields omitted */ }
Expand description

A Builder that configures and initializes the Godot logger

godot-logger implements the builder pattern as the primary interface to configure and initialize the logger. The configuration has sensible defaults that can be overwritten by calling the corresponding setters on the Builder struct. Once the configuration is done, the logger can be initialized by calling the build method.

Examples

use log::Level;
use godot_logger::GodotLogger;

GodotLogger::builder()
    .default_log_level(Level::Debug)
    .init();

Implementations

Sets the default log level

GodotLogger matches all log records against a default log level. By default, only warnings and errors are logged.

Examples
use log::Level;
use godot_logger::GodotLogger;

let mut builder = GodotLogger::builder();
builder = builder.default_log_level(Level::Debug);

Adds a filter

Filters override the default log level for specific Rust modules.

Examples
use godot_logger::GodotLogger;
use log::LevelFilter;

GodotLogger::builder().add_filter("godot_logger", LevelFilter::Off);

Initializes the logger

This method consumes the builder and initializes the logger with the current configuration of the builder. After calling this method, log records will be written to Godot’s output console.

Examples
use log::Level;
use godot_logger::GodotLogger;

GodotLogger::builder().init();

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.