Apollo

Struct Apollo 

Source
pub struct Apollo {
    pub logging_level: Levels,
}

Fields§

§logging_level: Levels

Implementations§

Source§

impl Apollo

Source

pub fn new() -> Apollo

Creates a new Apollo instance

§Examples
use crate::apollo_logger::Apollo;

let l = Apollo::new(); // The default logging level is Debug

l.debug("This message will be printed");
l.warn("This message will also be printed");

If you require a different logging level, please use the following code instead

use crate::apollo_logger::Apollo;
use crate::apollo_logger::levels::Levels;

let l = Apollo { logging_level: Levels::INFO };

l.debug("This message will NOT printed");
l.warn("This message will be printed");
Source

pub fn debug(&self, s: &str) -> Option<String>

Prints a message to the console with the DEBUG label_format

§Arguments
  • s: String to print to the console
§Examples
use crate::apollo_logger::Apollo;

let l = Apollo::new();

l.warn("This is an debug message");
Source

pub fn info(&self, s: &str) -> Option<String>

Prints a message to the console with the INFO label_format

§Arguments
  • s: String to print to the console
§Examples
use crate::apollo_logger::Apollo;

let l = Apollo::new();

l.info("This is an info message");
Source

pub fn warn(&self, s: &str) -> Option<String>

Prints a message to the console with the WARN label_format

§Arguments
  • s: String to print to the console
§Examples
use crate::apollo_logger::Apollo;

let l = Apollo::new();

l.warn("This is an warning message");
Source

pub fn error(&self, s: &str) -> Option<String>

Prints a message to the console with the ERROR label_format

§Arguments
  • s: String to print to the console
§Examples
use crate::apollo_logger::Apollo;

let l = Apollo::new();

l.error("This is an error message");
Source

pub fn critical(&self, s: &str) -> Option<String>

Prints a message to the console with the CRITICAL label_format

§Arguments
  • s: String to print to the console
§Examples
use crate::apollo_logger::Apollo;

let l = Apollo::new();

l.critical("This is an critical message");

Trait Implementations§

Source§

impl Default for Apollo

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for Apollo

§

impl RefUnwindSafe for Apollo

§

impl Send for Apollo

§

impl Sync for Apollo

§

impl Unpin for Apollo

§

impl UnwindSafe for Apollo

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.