Skip to content

Class clogged::Logger

ClassList > clogged > Logger

Logger class with colors and team names.More...

  • #include <EasyLogging.hpp>

Public Functions

Type Name
Logger & operator<< (Team team)
Sets the Team name for the current log.
Logger & operator<< (LogLevel logLevel)
sets the log level for the current log
Logger & operator<< (Color color)
colors of the log
Logger & operator<< (std::ostream &(*)(std::ostream &) manipulator)
Manipulator for endl so that we can reset the values when a team is done logging.
Logger & operator<< (const T & value)
Aye I used a template.

Public Static Functions

Type Name
Logger & Log ()
Logger & Log (T && arg1, EXTRA_Ts &&... extra_args)
std::ostream & endl (std::ostream & os)
Custom endl to reset the values.

Detailed Description

Not a fan of this practice But would prefer not to use parenthesis

Author:

@amantham20 @chatGPT

I was about to name this clogged.

This is a custom logger class that can be used to log messages to the console.

Public Functions Documentation

function operator<<

Sets the Team name for the current log.

inline Logger & clogged::Logger::operator<< (
    Team team
) 

Parameters:

  • team name of the team

Returns:

Logger&

function operator<<

sets the log level for the current log

inline Logger & clogged::Logger::operator<< (
    LogLevel logLevel
) 

Parameters:

  • logLevel Level/Type of the log

Returns:

Logger&

function operator<<

colors of the log

inline Logger & clogged::Logger::operator<< (
    Color color
) 

Parameters:

  • color

Returns:

Logger&

function operator<<

Manipulator for endl so that we can reset the values when a team is done logging.

inline Logger & clogged::Logger::operator<< (
    std::ostream &(*)(std::ostream &) manipulator
) 

Parameters:

  • manipulator

Returns:

Logger&

function operator<<

Aye I used a template.

template<typename T typename T>
inline Logger & clogged::Logger::operator<< (
    const T & value
) 

Function to log the value

Template parameters:

  • T

Parameters:

  • value

Returns:

Logger&

@TODO: Might have to change this so that we only break a team log when a new team is set. aka ensure that logger << Team::TEAM_1 << "Hello" << "World" << endl; works in one line with one team print

Public Static Functions Documentation

function Log [1/2]

static inline Logger & clogged::Logger::Log () 

Only instance of the logger once Changes requested from Dr.@ofria

Authors:

@mercere99

Returns:

a unique Logger instance

function Log [2/2]

template<typename T typename T, typename... EXTRA_Ts>
static inline Logger & clogged::Logger::Log (
    T && arg1,
    EXTRA_Ts &&... extra_args
) 

Only instance of the logger once Changes requested from Dr.@ofria

Authors:

@mercere99

Parameters:

  • arg1 Set of values that you want to have logged.

Returns:

Unique Logger instance

function endl

Custom endl to reset the values.

static inline std::ostream & clogged::Logger::endl (
    std::ostream & os
) 

Parameters:

  • os

Returns:

std::ostream&


The documentation for this class was generated from the following file source/core/EasyLogging.hpp