1 | <p align="center" id="lnm"> |
2 | <img src="/static/logobanner.png"/> |
3 | </p> |
4 | <p align="center"> |
5 | <i><b>(WIP)</b> A lightweight C logging library and parser for event-oriented logs.</i> |
6 | </p> |
7 | <p align="center"> |
8 | <a href="https://github.com/JoshuaS3/lognestmonster/blob/dev/LICENSE"> |
9 | <img src="https://img.shields.io/github/license/joshuas3/lognestmonster?style=flat-square"/> |
10 | </a> |
11 | <a href="https://github.com/JoshuaS3/lognestmonster/tree/dev"> |
12 | <img src="https://img.shields.io/badge/version-(WIP) 0.3.0-informational?style=flat-square"/> |
13 | </a> |
14 | <a href="https://github.com/JoshuaS3/lognestmonster/blob/dev/src/c/lognestmonster.h"> |
15 | <img src="https://img.shields.io/github/size/joshuas3/lognestmonster/src/c/lognestmonster.h?label=header%20size&style=flat-square"/> |
16 | </a> |
17 | <a href="https://app.codacy.com/manual/JoshuaS3/lognestmonster/dashboard"> |
18 | <img src="https://img.shields.io/codacy/grade/15048b0c7728497394651e295d61746b/dev?logo=codacy&style=flat-square"/> |
19 | </a> |
20 | <a href="https://travis-ci.com/JoshuaS3/lognestmonster"> |
21 | <img src="https://img.shields.io/travis/joshuas3/lognestmonster/dev?logo=travis&style=flat-square"/> |
22 | </a> |
23 | <a href="https://github.com/JoshuaS3/lognestmonster/actions"> |
24 | <img src="https://img.shields.io/github/workflow/status/JoshuaS3/lognestmonster/C Header Unit Tests?label=C%20Header%20Unit%20Tests&logo=github&style=flat-square"/> |
25 | </a> |
26 | <p> |
27 |
|
28 | Lognestmonster is a general-purpose single-header C logging library that |
29 | pertains a number of features: |
30 |
|
31 | * Nested/layer-based logging capabilities |
32 | * Event-oriented log compilation |
33 | * Multiple queues or outputs |
34 | * Full developer customizability on memory allocation |
35 | * Preprocessor handles to incorporate non-standard memory functions |
36 | * Full developer customizability on I/O redirection |
37 | * Generic filesystem log output |
38 | * End-to-end `stdout` and `stdin` piping, allowing data transfer over serial, |
39 | socket, or anything else |
40 | * A binary format lighter than plaintext |
41 | * A feature-packed but comprehensive standalone deserializer/parser |
42 | * Interactive textual UI (ncurses) |
43 | * Logtree filtering/sorting and navigation |
44 | * Data operations such as binary to plaintext conversions and custom hooks on |
45 | user-defined events |
46 | * Optional daemon for hook events |
47 | * Full developer customizability on data display, program controls, and hook |
48 | operations |
49 |
|
50 | _**(WIP)** Not yet meant for development or production use_ |
51 |
|
52 | ## Performance at Different Optimization Levels |
53 |
|
54 | Output of `./test performance` as of commit `b54160c`: |
55 |
|
56 | Optimization Level | Header Binary Size\* (in bytes) | Unit Test Runtime\*\* (in µs) |
57 | ------------------ | ------------------------------- | ----------------------------- |
58 | -O0 | 22552 | 70 |
59 | -O1 | 18424 | 67 |
60 | -O2 | 22520 | 69 |
61 | -O3 | 26760 | 68 |
62 | -Os | 18424 | 69 |
63 |
|
64 | \*Header binary size is measured by compilation of the following source file: |
65 |
|
66 | ```c |
67 | // tests/header_only.c |
68 | #define LNM_INIT |
69 | #include "lognestmonster.h" |
70 | |
71 | int main(void) { |
72 | return 0; |
73 | } |
74 | ``` |
75 |
|
76 | \*\*Median taken from 200 trials run in sequence to account for variable processor |
77 | conditions and behaviors. Run on a mid-tier 3.3GHz processor (i5-4590). Runtime |
78 | is measured by the execution and output of [the header's unit |
79 | test](tests/header_unit.c). |
80 |
|
81 | ## Copyright |
82 |
|
83 | This package is copyrighted by [Joshua 'joshuas3' |
84 | Stockin](https://joshstock.in/) and licensed under the [MIT License](LICENSE). |
85 |
|
86 | A form of the following should be present in each major library source or header |
87 | file. |
88 |
|
89 | ```txt |
90 | lognestmonster Copyright (c) 2020 Joshua 'joshuas3' Stockin |
91 | <https://joshstock.in> |
92 | <https://github.com/JoshuaS3/lognestmonster> |
93 | This software is licensed under the MIT License. |
94 | ``` |
95 |
|