diff options
author | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2018-01-24 10:00:02 +0100 |
---|---|---|
committer | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2018-01-24 10:00:02 +0100 |
commit | dc50663fa07d178fead64e729dad82b32c429661 (patch) | |
tree | 82100372b74d1f55c72842acb918e2fabfeee612 | |
parent | 7dda17b28602e7f6794a30c122d1bf34632882f6 (diff) | |
download | embedlog-dc50663fa07d178fead64e729dad82b32c429661.tar.gz embedlog-dc50663fa07d178fead64e729dad82b32c429661.tar.bz2 embedlog-dc50663fa07d178fead64e729dad82b32c429661.zip |
update: documentation
-rw-r--r-- | man/el_init.3 | 20 | ||||
-rw-r--r-- | man/el_overview.7 | 4 | ||||
-rw-r--r-- | man/el_print.3 | 19 | ||||
-rw-r--r-- | readme.md | 91 |
4 files changed, 82 insertions, 52 deletions
diff --git a/man/el_init.3 b/man/el_init.3 index 7d34a0c..cc75954 100644 --- a/man/el_init.3 +++ b/man/el_init.3 @@ -12,6 +12,23 @@ .BI "int el_oinit(struct options *" options ")" .SH DESCRIPTION .PP +There are two types of functions in +.BR embedlog. +Functions that use global static structure inside library, these functions don't +accept +.I options +argument, and are not thread-safe. +.PP +Another type are functions that accept +.I options +argument. These functions are prefixed with +.BR el_o . +Options functions are thread-safe provided that threads are working on different +.I options +objects and +.B \-\-enable\-reentrant +is turned on. +.PP .BR el_init (3) initializes static global option structure. This option structure is used by all functions that don't accept @@ -24,7 +41,8 @@ this is the function you want to use. .BR el_oinit (3) initializes only .I options -structure passed to it. Only after that functions that accepts +structure passed to it. +Functions that accepts .I options may be used. If you want to have multiple embedlog instances (ie. one for program logs, diff --git a/man/el_overview.7 b/man/el_overview.7 index 3a4947b..f6f4955 100644 --- a/man/el_overview.7 +++ b/man/el_overview.7 @@ -31,10 +31,6 @@ Logger incorporates features like: .br - file (with optional rotating) .br -- net (TODO: not implemented yet) -.br -- tty - directly to chosen serial console (TODO: not implemented yet) -.br - custom routine, can be anything, embedlog just calls your function with string to print .RE diff --git a/man/el_print.3 b/man/el_print.3 index e9568e3..68d56fa 100644 --- a/man/el_print.3 +++ b/man/el_print.3 @@ -4,6 +4,7 @@ .BR el_print , .BR el_vprint , .BR el_puts , +.BR el_pmemory, .B el_perror - prints message to previously configured outputs. .SH SYNOPSIS @@ -122,10 +123,20 @@ It is similar to function. .PP .BR el_pmemory (3) -is designed to print memory location in a nice hex+ascii format that may look -like this. -In this example we print all ascii table, to present printing of printable and -non-printable values. +is designed to print memory location in a nice hex+ascii format. +Function accepts pointer to +.I memory +and +.I mlen +number of bytes caller wants to print. +Function doesn't care what is under passed address, memory block may contain +strings with null characters '\\0', integers, floats or even +.B struct +objects. +.PP +Example output can look like this. +We print all ascii table, to present printing of printable and non-printable +values. .PP .EX ------ ----------------------------------------------- ---------------- @@ -1,41 +1,51 @@ About ===== -Logger written in C89 targeting embedded systems. It's main goals are to be +Logger written in **C89** targeting embedded systems. It's main goals are to be small and fast. Many features can be disabled during compilation to generate smaller binary. Ammount of needed stack memory can be lowered by adjusting -maximum printable size of single log message. Implemented features are: - - * printing to different outputs (simultaneously) like: - - standard error (stderr) - - file (with optional log rotate) - - custom routine - can be anything **embedlog** just calls custom function +maximum printable size of single log message. Altough logger focuses on embedded +systems, it is general **c/c++** logger that can be used in any application. +Implemented features are: + +* printing to different outputs (simultaneously) like: + * standard error (stderr) + * file (with optional log rotate) + * custom routine - can be anything **embedlog** just calls custom function with string to print - * timestamp to every message - - clock_t - - time_t - - CLOCK_REALTIME (requires POSIX) - - CLOCK_MONOTONIC (requires POSIX) - * print location of printed log (file and line) - * 8 predefinied log levels and (sizeof(int) - 8) custom log levels ;-) - * colorful output (ansi colors) for easy error spotting - * print memory block in wireshark-like output +* appending timestamp to every message + * clock_t + * time_t + * CLOCK_REALTIME (requires POSIX) + * CLOCK_MONOTONIC (requires POSIX) +* print location of printed log (file and line) +* 8 predefinied log levels and (sizeof(int) - 8) custom log levels ;-) +* colorful output (ansi colors) for easy error spotting +* print memory block in wireshark-like output Almost all of these features can be disabled to save some precious bytes of memory. -Dependencies -============ +Functions description +===================== -Library is written in C89 but some features require implemented POSIX to work. -Also there are some additional features for users with C99 compiler. +For detailed description of every function check out +[man pages](http://embedlog.kurwinet.pl/manuals.html) -To run unit tests, you also need [librb][https://github.com/mlyszczek/librb] +Examples +======== -License -======= +Check [examples](http://git.kurwinet.pl/embedlog/tree/examples) directory to get +the idea of how to use **embedlog**. Examples can also be compiled to see how +they work. + +Dependencies +============ + +Library is written in **C89** but some features require implemented **POSIX** to +work. Also there are some additional features for users with **C99** compiler. -Library is licensed under BSD 2-clause license. See LICENSE file for details +To run unit tests, you also need [librb](http://librb.kurwinet.pl) Compiling and installing ======================== @@ -71,28 +81,23 @@ $ cd examples $ make ~~~ -Examples -======== - -Check *examples* directory to get the idea of how to use **embedlog**. Examples -can also be compiled to see how they work. - -Functions description -===================== - -For detailed description of every function check out man pages. - Contact ======= Michał Łyszczek <michal.lyszczek@bofc.pl> -Thanks to -========= +License +======= + +Library is licensed under BSD 2-clause license. See +[LICENSE](http://git.kurwinet.pl/embedlog/tree/LICENSE) file for details + +See also +======== -- Mark Martinec for nice C89 implementation of snprintf and familly - (https://www.ijs.si/software/snprintf/) -- Myself for developing very simple unit test framework -(https://github.com/mlyszczek/mtest) for easy testing -- Myself for developing ring buffer used in unit tests - (https://github.com/mlyszczek/librb) +* [c89 snprintf function family](https://www.ijs.si/software/snprintf) by + Mark Martinec +* [mtest](http://mtest.kurwinet.pl) unit test framework **embedlog** uses +* [librb](http://librb.kurwinet.pl) ring buffer used in unit tests +* [git repository](http://git.kurwinet.pl/embedlog) to browse code online +* [continous integration](http://ci.embedlog.kurwinet.pl) for project |