mambrus / liblog Goto Github PK
View Code? Open in Web Editor NEWC-library: functions for logging, debug printouts
License: MIT License
C-library: functions for logging, debug printouts
License: MIT License
Logging is also a way of printf debugging. For RT sensitive issues it may very well be the only way to understand an issue, i.e. when time is a factor of the problem itself.
For debugging purposes by enabling LOG_LEVEL=DEBUG
, logs can clobber the view (and also slow down execution which in turn may cause ghost issues).
I.e. prevent that too much is logged (by log-probes from every corner of your code), by enabling only what is needed. IOW a finer granularity of control than LOG_LEVEL alone.
LOGX can be used much like linux kernel ftrace
probes, by turning specific areas on and off. Thereby leaving the probes in code, but activate them only on demand using filtering.
ftrace does this using chains of rules. Exactly how liblog
will leverage on the concept isn't determined as it's needed to consider more use-cases. From deeply embedded
with no kernel support, to high-end UN*X
based systems with abilities to use collaborating services.
Additional consideration to take into account is also to keep the configuration as low as possible to not prevent incorporation in (especially) resource constrained projects.
If liblog is used in interrupt context or by some kernels threads => libc isn't neither thread safe (newlib implementation i.e. the most common libc for MCU:s) nor re-entrant. Latter is true not only MCU use-cases.
printf with friends are also known to be unnecessarily big. For most logging purposes, floating-point handling and ditto formatting is quite un-necessary.
This may not be a liblog issue but a system issue (link which library). There may however be a need to distinguish one API from another in base both need to be used.
Labelled "investigate" for the causes mentioned above.
In (especially) embedded projects, logging to an UART
directly may case RT-issues, i.e. creating new problems. This is solved by logging to RAM instead as an intermediate step, there-by decoupling the probing-phase
from the print-out/inspection-phase
.
(Something needs to pull the logs of-course, but that is not the primary concern in this issue as it may probably be done differently from case-to-case.)
Considerations:
malloc
(i.e. allocated buffert-pointers). In the deeply embedded case with low RAM boundary protection, and especially considering that logs themselves become imperative for analysing fault's, logs must not be damaged.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.