michaelgalassi / liblog Goto Github PK
View Code? Open in Web Editor NEWLiblog is a very fast low-overhead logger targeted at developers.
License: BSD 2-Clause "Simplified" License
Liblog is a very fast low-overhead logger targeted at developers.
License: BSD 2-Clause "Simplified" License
Liblog is a very fast low-overhead logger targeted at developers. It is not meant for customer use. Liblog is a tiny daemon which maintains a small shared memory segment to which your application writes it's messages. When you need a copy of the messages you need but run "killall -USR1 lldump" and the shared memory segment will be written to disk. New messages overwrite old ones when the log buffer fills up. The messages can then be extracted with the llcat utility. The interface is very simple. Logging is initiated with a call to ll_open(), there are two arguments, the minimum logging level and the size of the shared memory buffer. Log levels are defined in liblog.h. ll_open creates the shared memory segment and starts the daemon. It returns 0 on success, -1 on failure. One writes to the log with calls to ll_log(), the arguments are the level, a printf style format string, and a variable number of arguments. When you're done you terminate logging with ll_close() which flushes the buffer to disk and frees the shared memory segment. Because the shared memory segment has a header in front of your messages and the messages are not necessarily in order a small utility is provided to examine the messages, it is called llcat and it takes one argument, the name of the logfile to be displayed. It's usage might look something like this: #include <liblog.h> int main(int argc, char **argv) { if (debug) { /* log warnings and above, keep last 16k */ if (ll_open(LL_LVL_WARN, 16*1024) == -1) { (void)fprintf(stderr, "failed to open liblog\n"); return 1; } } ... /* log anything above debug */ (void)ll_setlevel(LL_LVL_DBG); if (debug) { ll_log(LL_LVL_NOTE, "i: %d str: %s\n, i, s); } ... /* this also flushes to disk */ ll_close(); return 0; }
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.