创建日志文件周期性开源解决方案? [英] Open-source solutions for creating a cyclical logfile?
问题描述
if (!wheel) { wheel = new Wheel(); } // or some such
我的谷歌眼镜今天不工作太清楚了。我想这其中一定是codeD已经一个极大次,寻找一些开放源码软件code,但找不到任何。
My google goggles aren't working too well today. I figured this one must have been coded a gazillion times already and was looking for some FOSS code, but couldn't find any.
在我重新发明的球形轴周围的设备,任何人都可以点我在一个网址?
Before I reinvent the spherical axle-surrounding device, can anyone point me at a URL?
我用C编码嵌入式系统(爱特梅尔UC3),但是这不应该使任何区别,只是解释为什么我需要一个周期性的日志文件(因为有限的存储)。
I am coding in C for an embedded system (Atmel UC3), but that shouldn't make any difference, just explain why I need a cyclical logfile (because of limited storage).
我想将事件记录到文件中在SD卡上,当达到一定规模我要开始在开始重新动笔。所有网址是什么? (固定条目大小是确定的;否则,它可能会在重叠讨厌)。
I want to log events to a file on an SD card and when the reaches a certain size I want to start writing again at the start. Any URLs for that? (fixed entry size is ok; otherwise it might get nasty on wraparound).
在此先感谢1,000,000!
Thanks a 1,000,000 in advance!
推荐答案
Sourceforge上有一个名为循环日志的项目,该项目可能会你所需要的。
Sourceforge has a project called Cyclic Logs which may be what you need.
如果不是,这不是最难实现的事情。只需把它像一个正常的循环内存空间。但不是有它驻留在内存中有它驻留在磁盘上。
If not, it's not the hardest thing to implement. Just treat it like a normal cyclic memory space. But instead of having it be resident in memory have it reside on the disk.
(维持的指针日志的头部和日志的末端(增量根据需要))
( maintain a pointer to the head of the log and the end of the log ( increment as needed ))
存储这些作为标题来记录或作为其他平面文件。
Store those as headers to the log or as another flat file.
这篇关于创建日志文件周期性开源解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!