diff options
author | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2018-05-06 00:11:26 +0200 |
---|---|---|
committer | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2018-05-06 00:11:31 +0200 |
commit | 139b36f884098cced07bd045e429b734dff0bef4 (patch) | |
tree | f627f0cc8c223d72fb1f91ed48fe824276a07866 | |
parent | 6e8227a567ea9c09d8e0640d291d830701227f29 (diff) | |
download | embedlog-139b36f884098cced07bd045e429b734dff0bef4.tar.gz embedlog-139b36f884098cced07bd045e429b734dff0bef4.tar.bz2 embedlog-139b36f884098cced07bd045e429b734dff0bef4.zip |
little fixes in documentation
no_buildbot
-rw-r--r-- | man/el_option.3 | 1 | ||||
-rw-r--r-- | man/el_overview.7 | 70 | ||||
-rw-r--r-- | man/el_print.3 | 6 | ||||
-rw-r--r-- | readme.md | 2 |
4 files changed, 72 insertions, 7 deletions
diff --git a/man/el_option.3 b/man/el_option.3 index 23280b3..012e435 100644 --- a/man/el_option.3 +++ b/man/el_option.3 @@ -1,5 +1,6 @@ .TH "el_option" "3" " 3 May 2018 (v0.3.0)" "bofc.pl" .SH NAME +.PP .B el_option - sets optional configuration of the logger .SH SYNOPSIS diff --git a/man/el_overview.7 b/man/el_overview.7 index 3da9d9b..fec6808 100644 --- a/man/el_overview.7 +++ b/man/el_overview.7 @@ -27,9 +27,13 @@ Logger incorporates features like: .RS - stderr .br -- syslog +- syslog (very limited, works on *nuttx* for now) .br -- file (with optional rotating) +- directly to serial device (like /dev/ttyS0) +.br +- file (with optional rotating and syncing to prevent data loss) +.br +- automatic file reopening on unexpected events (file deletion, SD remount) .br - custom routine, can be anything, embedlog just calls your function with string to print @@ -43,12 +47,18 @@ string to print - CLOCK_REALTIME (requires POSIX) .br - CLOCK_MONOTONIC (requires POSIX) +.br +- configurable precision of fraction of seconds (mili, micro, nano) .RE - printing file and line information .br -- 8 predefined log levels (and [sizeof(int) - 8] custom levels ;-)) +- 8 predefined log levels (total rip off from syslog(2) levels) .br - colorful output (for easy error spotting) +.br +- print memory block in wireshark-like output +.br +- fully binary logs with binary data (like CAN frames) to save space .RE .RE .PP @@ -62,6 +72,8 @@ Library implements following functions: .br .BI "int el_puts(const char *" string ")" .br +.BI "int el_putb(const void *" memory ", size_t " mlen ")" +.br .BI "int el_print(const char *" file ", size_t " line ", \ enum el_level " level ", const char *" fmt ", " ... ")" .br @@ -73,6 +85,9 @@ enum el_level " level ", const void *" memory ", size_t " mlen ")" .br .BI "int el_perror(const char *" file ", size_t " line ", \ enum el_level " level ", const char *" fmt ", " ... ")" +.br +.BI "int el_pbinary(enum el_level " level ", const void *" memory ", \ +size_t " mlen ") .PP Each functions has its equivalent function but accepting .I options @@ -92,6 +107,9 @@ for more information. .br .BI "int el_oputs(struct el_options *" options ", const char *" string ")" .br +.BI "int el_oputb(struct el_options *" options ", const void *" memory ", \ +size_t " mlen ")" +.br .BI "int el_oprint(const char *" file ", size_t " line ", \ enum el_level " level ", struct el_options *" options ", \ const char * "fnt ", " ... ")" @@ -107,6 +125,9 @@ const void *" memory ", size_t " mlen ")" .BI "int el_operror(const char *" file ", size_t " line ", \ enum el_level " level ", struct el_options *" options ", \ const char *" fmt ", " ... ")" +.br +.BI "int el_opbinary(enum el_level " level ", struct el_options *" options ", \ +const void *" memory ", size_t " mlen ")" .PP For more information about a function open manual page with functions name from section 3 (ie. for el_oputs, you'd open @@ -150,6 +171,49 @@ You can simply call it like .EX el_print(ELN, "Notice message"); .EE +.PP +There are also equivalent macros for use with functions that also accepts +.IR options . +To make these work, you need to provide +.B EL_OPTIONS_OBJECT +macro. +Check +.BR el_print (3) +for more info about that. +.PP +.RS +.BR OELF " Fatal errors, usually precedes application crash" +.br +.BR OELA " Alert, vey major error that should be fixed as soon as possible" +.br +.BR OELC " Critical" +.br +.BR OELE " Error" +.br +.BR OELW " Warning" +.br +.BR OELN " Normal log, but of high importance" +.br +.BR OELI " Information message, shouldn't spam too much here" +.br +.BR OELD " Debug messages, can spam as much as you'd like" +.RE +.PP +So instead of calling +.PP +.EX + el_oprint(__FILE__, __LINE__, EL_NOTICE, &g_log_object, "Notice message"); +.EE +or +.EX + el_oprint(ELN, &g_log_object, "Notice message"); +.EE +.PP +You can simply call it like +.PP +.EX + el_oprint(OELN, "Notice message"); +.EE .SH EXAMPLE .PP Initial setup is very trivial. diff --git a/man/el_print.3 b/man/el_print.3 index c7d01d8..93b0090 100644 --- a/man/el_print.3 +++ b/man/el_print.3 @@ -32,7 +32,7 @@ size_t " mlen ") .PP .BI "int el_oputs(struct el_options *" options ", const char *" message ")" .br -.BI "int el_putb(struct el_options *" options ", const void *" memory ", \ +.BI "int el_oputb(struct el_options *" options ", const void *" memory ", \ size_t " mlen ")" .br .BI "int el_oprint(const char *" file ", size_t " line ", \ @@ -47,11 +47,11 @@ const char *" fmt ", va_list " ap ")" enum el_level " level ", struct el_options *" options ", \ const char *" fmt ", " ... ")" .br -.BI "int el_pmemory(const char *" file ", size_t " line ", \ +.BI "int el_opmemory(const char *" file ", size_t " line ", \ enum el_level " level ", struct el_options *" options ", \ const void *" memory ", size_t " mlen ")" .br -.BI "int el_pbinary(enum el_level " level ", struct el_options *" options ", \ +.BI "int el_opbinary(enum el_level " level ", struct el_options *" options ", \ const void *" memory ", size_t " mlen ")" .PP .BI "#define ELF " __FILE__ ", " __LINE__ ", " EL_FATAL @@ -64,7 +64,7 @@ architectures. No exceptions. operating system tests ---------------------- -* arm-cortex-m4-nuttx (manual) ![test-result-svg][fsan] +* arm-cortex-m4-nuttx-7.24 (manual) ![test-result-svg][fsan] * parisc-polarhome-hpux-11.11 ![test-result-svg][prhpux] * power4-polarhome-aix-7.1 ![test-result-svg][p4aix] * i686-builder-freebsd-11.1 ![test-result-svg][x32fb] |