mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-21 01:13:37 +08:00
!12 api增加日志分片文件大小和文件个数配置接口
Merge pull request !12 from 倔强的土豆/feature/add_log_config
This commit is contained in:
commit
fc4380fffc
@ -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