PMT Renovated main-branch
Partition Manager Tool is a fast, reliable, and feature-rich CLI application for Android devices that enables advanced partition operations such as backup, flashing, erasing, information retrieval, and more.
Loading...
Searching...
No Matches
Helper::Logger Class Reference

Modern, functional logger class. More...

#include <logging.hpp>

Classes

class  Properties
 It is a class that holds the logging properties. More...
 

Public Member Functions

 ~Logger ()
 The log text is finalized, and if necessary, write operations to a file or to stdout are performed.
 
 Logger (const Logger &)=delete
 
 Logger (const LogLevels level, std::string function, std::string logFile, std::string name, std::string file, int line)
 
template<typename T >
Loggeroperator<< (const T &msg)
 To use the << operator for receiving non-function-like inputs.
 
Loggeroperator<< (std::ostream &(*msg)(std::ostream &))
 To use the << operator for receiving function-like inputs.
 
Loggeroperator= (const Logger &)=delete
 
template<typename... Args>
Loggerwrite (std::format_string< Args... > fmt, Args &&...args)
 Function for modern std::print style logging.
 

Static Public Member Functions

static bool moveOldLogs (const std::filesystem::path &oldLogFile, const std::filesystem::path &newLogFile, bool remove=false)
 Transfers the contents of the old log file to the new one.
 

Detailed Description

Modern, functional logger class.

Note
It is recommended to use ready-made macros to benefit from this class.
See also
Helper::Logger::Properties

Member Function Documentation

◆ moveOldLogs()

static bool Helper::Logger::moveOldLogs ( const std::filesystem::path oldLogFile,
const std::filesystem::path newLogFile,
bool  remove = false 
)
inlinestatic

Transfers the contents of the old log file to the new one.

Parameters
oldLogFileOld log file.
newLogFileNew log file.
removeWill the old log file be deleted?
Returns
Returns true if successful. Otherwise, false.
Note
This function is called automatically when the log file path is changed.

The documentation for this class was generated from the following file: