#pragma once

// -----------------------------------------------------------------------------
// logger.h
// -----------------------------------------------------------------------------
// Thread-safe file logger that appends lines to "log.txt" next to the
// executable. Every entry carries a severity level and a local timestamp:
//
//   [2026-08-15 13:57:37] [INFO ] message
//
// Used by every module to record debug and diagnostic output.
// -----------------------------------------------------------------------------

#include <string>

namespace util {

// Severity levels, ordered from least to most severe.
enum class Level
{
	Debug,
	Info,
	Warning,
	Error,
	Fatal,
};

// Appends a single line to log.txt (created next to the executable).
// The call is thread-safe: concurrent writers are serialized by a mutex.
void Log(Level level, const std::string& message);

// Convenience wrappers for the individual severity levels.
void LogDebug(const std::string& message);
void LogInfo(const std::string& message);
void LogWarning(const std::string& message);
void LogError(const std::string& message);
void LogFatal(const std::string& message);

} // namespace util