- Added LogLevel parameter to Channel constructor and updated derived classes (FileChannel, StdoutChannel) to accept it. - Modified log methods to respect the logging level, preventing lower priority logs from being processed. - Updated Log class to set logging levels for stdout and file channels. - Adjusted main function to initialize logging with specified levels.
19 lines
578 B
C++
19 lines
578 B
C++
#pragma once
|
|
|
|
#include <webserv/log/Channel.hpp>
|
|
|
|
class StdoutChannel : public Channel
|
|
{
|
|
public:
|
|
StdoutChannel(LogLevel logLevel = LogLevel::LOGLVL_TRACE);
|
|
|
|
StdoutChannel(const StdoutChannel &other) = delete;
|
|
StdoutChannel(const StdoutChannel &&other) = delete;
|
|
StdoutChannel &operator=(const StdoutChannel &other) = delete;
|
|
StdoutChannel &&operator=(const StdoutChannel &&other) = delete;
|
|
|
|
~StdoutChannel();
|
|
|
|
void log(LogLevel &logLevel, const std::string &message,
|
|
const std::map<std::string, std::string> &context = {}) override;
|
|
}; |