mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-25 04:08:57 +08:00
api增加log日志文件参数设置
This commit is contained in:
parent
10c4608630
commit
8b1bccdd00
@ -106,6 +106,13 @@ API_EXPORT void API_CALL mk_env_init1(int thread_num,
|
||||
const char *ssl,
|
||||
const char *ssl_pwd);
|
||||
|
||||
/**
|
||||
* 设置日志文件
|
||||
* @param file_max_size 单个切片文件大小(MB)
|
||||
* @param file_max_count 切片文件个数
|
||||
*/
|
||||
API_EXPORT void API_CALL mk_set_log(int file_max_size, int file_max_count);
|
||||
|
||||
/**
|
||||
* 设置配置项
|
||||
* @param key 配置项名
|
||||
|
@ -121,6 +121,14 @@ API_EXPORT void API_CALL mk_env_init1(int thread_num,
|
||||
});
|
||||
}
|
||||
|
||||
API_EXPORT void API_CALL mk_set_log(int file_max_size, int file_max_count) {
|
||||
auto channel = dynamic_pointer_cast<FileChannel>(Logger::Instance().get("FileChannel"));
|
||||
if (channel) {
|
||||
channel->setFileMaxSize(file_max_size);
|
||||
channel->setFileMaxCount(file_max_count);
|
||||
}
|
||||
}
|
||||
|
||||
API_EXPORT void API_CALL mk_set_option(const char *key, const char *val) {
|
||||
assert(key && val);
|
||||
if (mINI::Instance().find(key) == mINI::Instance().end()) {
|
||||
|
Loading…
Reference in New Issue
Block a user