invole c++
This commit is contained in:
28
cpp_ext/native_logger.hpp
Normal file
28
cpp_ext/native_logger.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace netcore {
|
||||
|
||||
enum class LogLevel : int {
|
||||
kError = 0,
|
||||
kWarn = 1,
|
||||
kInfo = 2,
|
||||
kDebug = 3,
|
||||
};
|
||||
|
||||
// Set log file path. If empty, logging is disabled.
|
||||
void set_log_file(const std::string& path);
|
||||
|
||||
// Set minimum log level to write (default: kInfo).
|
||||
void set_log_level(LogLevel level);
|
||||
|
||||
// Log helpers (thread-safe, never calls into Python).
|
||||
void log(LogLevel level, const std::string& msg);
|
||||
void log_debug(const std::string& msg);
|
||||
void log_info(const std::string& msg);
|
||||
void log_warn(const std::string& msg);
|
||||
void log_error(const std::string& msg);
|
||||
|
||||
} // namespace netcore
|
||||
|
||||
Reference in New Issue
Block a user