hello-world-cpp/task_3/log_writer.h

24 lines
503 B
C
Raw Normal View History

2025-01-10 11:17:15 +10:00
#include <string>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
2025-01-10 14:44:36 +10:00
#include <ctime>
2025-01-10 11:17:15 +10:00
class LogWriter {
public:
2025-01-10 14:44:36 +10:00
static int log_start_line();
static int log_counter(int counter);
static int log_copy_start(int counter, std::string copy_name);
static int log_copy_finish(std::string copy_name);
static int log_copy_error(std::string copy_name);
2025-01-10 11:17:15 +10:00
2025-01-10 14:44:36 +10:00
protected:
static std::string get_current_time();
2025-01-10 11:17:15 +10:00
private:
static int write_log(const std::string& log_line);
2025-01-10 14:44:36 +10:00
2025-01-10 11:17:15 +10:00
};