leechanx / ring-log Goto Github PK
View Code? Open in Web Editor NEWRing-Log是一个高效简洁的C++异步日志, 其特点是效率高(每秒支持至少125万+日志写入)、易拓展,尤其适用于频繁写日志的场景
Ring-Log是一个高效简洁的C++异步日志, 其特点是效率高(每秒支持至少125万+日志写入)、易拓展,尤其适用于频繁写日志的场景
请问日志打印的格式可以自由调整吗?还有是按照天生成日志文件的吗?会自动清理日志吗?谢谢~
cell buffer 刚好写满了,应该与cell buffer的容量不够用的处理方式应该是一样的啊?
比如改成跨平台的
rt
linux qt 下初始化后,只创建了目录没创建文件 这是什么原呢?
你好:
append这个函数,memcpy(_data + _used_len, log_line, len);这句话很偶现会引起程序core
请问调试时如何输出到标准输出
Line 146 in b2284ca
这里是否会有时间错乱的问题?内部的utc_fomat获取后可能被其他线程修改
if (_curr_buf->status == cell_buffer::FREE) {
_curr_buf->status = cell_buffer::FULL; // set to FULL
cell_buffer* next_buf = _curr_buf->next;
// tell backend thread 通知消费者线程把cell中的log更新到文件。
tell_back = true;
// it suggest that this buffer is under the persist job
if (next_buf->status == cell_buffer::FULL) {
// if mem use < MEM_USE_LIMIT, allocate new cell_buffer
if (_one_buff_len * (_buff_cnt + 1) > MEM_USE_LIMIT) {
fprintf(stderr, "no more log space can use\n");
_curr_buf = next_buf;
_lst_lts = curr_sec;
} else {
cell_buffer* new_buffer = new cell_buffer(_one_buff_len);
_buff_cnt += 1;
new_buffer->prev = _curr_buf;
_curr_buf->next = new_buffer;
new_buffer->next = next_buf;
next_buf->prev = new_buffer;
_curr_buf = new_buffer;
}
} else {
// next buffer is free, we can use it
_curr_buf = next_buf;
}
if (!_lst_lts) _curr_buf->append(log_line, len);
} else //_curr_buf->status == cell_buffer::FULL, assert persist is on here
// too!
{
_lst_lts = curr_sec;
}
当cell buffer满了的时候,不是应该寻找下一个空的cell buffer吗,为什么这个是没有处理的?
当缓冲区写满后,并且超过最大容量限制,此时会发生日志丢失!!!
我想复现你测试结果,不过test文件夹里的似乎就是异步的代码?
我该怎么去做同步和异步的对比测试呢?不知是否有现成的代码呢?
若能回复,不胜感激!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.