2019-02-11 15:20:43 +08:00
|
|
|
/*
|
|
|
|
* _log.cpp
|
|
|
|
*
|
|
|
|
* Created on: 2019-2-11
|
|
|
|
* Author: fasiondog
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <hikyuu/Log.h>
|
2023-12-27 02:16:10 +08:00
|
|
|
#include "pybind_utils.h"
|
2019-02-11 15:20:43 +08:00
|
|
|
|
|
|
|
using namespace hku;
|
2023-12-27 02:16:10 +08:00
|
|
|
namespace py = pybind11;
|
2019-02-11 15:20:43 +08:00
|
|
|
|
2023-12-27 02:16:10 +08:00
|
|
|
void export_log(py::module& m) {
|
|
|
|
py::enum_<LOG_LEVEL>(m, "LOG_LEVEL")
|
2024-01-21 02:58:20 +08:00
|
|
|
.value("DEBUG", LOG_LEVEL::LOG_DEBUG)
|
|
|
|
.value("TRACE", LOG_LEVEL::LOG_TRACE)
|
|
|
|
.value("INFO", LOG_LEVEL::LOG_INFO)
|
|
|
|
.value("WARN", LOG_LEVEL::LOG_WARN)
|
|
|
|
.value("ERROR", LOG_LEVEL::LOG_ERROR)
|
|
|
|
.value("FATAL", LOG_LEVEL::LOG_FATAL)
|
|
|
|
.value("OFF", LOG_LEVEL::LOG_OFF)
|
2023-12-27 02:16:10 +08:00
|
|
|
.export_values();
|
2019-02-11 15:20:43 +08:00
|
|
|
|
2023-12-27 02:16:10 +08:00
|
|
|
m.def("get_log_level", get_log_level, "获取当前日志级别");
|
|
|
|
m.def("set_log_level", set_log_level, "设置当前日志级别");
|
2019-02-11 15:20:43 +08:00
|
|
|
}
|