aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Łyszczek <michal.lyszczek@bofc.pl>2018-04-26 23:02:55 +0200
committerMichał Łyszczek <michal.lyszczek@bofc.pl>2018-04-26 23:02:55 +0200
commit1647ce904341f863112ad5cbe2f58704b2b44a58 (patch)
treefc0941f4a811ae357fdc7055fd7544b318e7b9f5
parent96b49416b55838ed3324470b643b613cc42d0a3c (diff)
downloadembedlog-1647ce904341f863112ad5cbe2f58704b2b44a58.tar.gz
embedlog-1647ce904341f863112ad5cbe2f58704b2b44a58.tar.bz2
embedlog-1647ce904341f863112ad5cbe2f58704b2b44a58.zip
udpdated documentation
-rw-r--r--man/el_print.347
-rw-r--r--readme.md53
2 files changed, 94 insertions, 6 deletions
diff --git a/man/el_print.3 b/man/el_print.3
index 3249ecd..99afc58 100644
--- a/man/el_print.3
+++ b/man/el_print.3
@@ -70,6 +70,22 @@ const void *" memory ", size_t " mlen ")"
.br
.BI "#define ELD " __FILE__ ", " __LINE__ ", " EL_DBG
.PP
+.BI "#define OELF " __FILE__ ", " __LINE__ ", " EL_FATAL ", " EL_OPTIONS_OBJECT
+.br
+.BI "#define OELA " __FILE__ ", " __LINE__ ", " EL_ALERT ", " EL_OPTIONS_OBJECT
+.br
+.BI "#define OELC " __FILE__ ", " __LINE__ ", " EL_CRIT ", " EL_OPTIONS_OBJECT
+.br
+.BI "#define OELE " __FILE__ ", " __LINE__ ", " EL_ERROR ", " EL_OPTIONS_OBJECT
+.br
+.BI "#define OELW " __FILE__ ", " __LINE__ ", " EL_WARN ", " EL_OPTIONS_OBJECT
+.br
+.BI "#define OELN " __FILE__ ", " __LINE__ ", " EL_NOTICE ", " EL_OPTIONS_OBJECT
+.br
+.BI "#define OELI " __FILE__ ", " __LINE__ ", " EL_INFO ", " EL_OPTIONS_OBJECT
+.br
+.BI "#define OELD " __FILE__ ", " __LINE__ ", " EL_DBG ", " EL_OPTIONS_OBJECT
+.PP
.BI "#define EL_DEBUG(" ... ") el_print(ELD, __VA_ARGS__)
.PP
Feature Test Macro
@@ -290,6 +306,25 @@ This is useful if we want for example, print logs into one file, and program
queries into another.
It can also be used to print every level into different file.
.PP
+When user defines
+.B EL_OPTIONS_OBJECT
+macros with
+.B OEL*
+can be used to save yourself the trouble to type
+.B &opt_obj
+each time.
+This macro should be defined to what normally would be passed to
+.B el_oprint
+functions familly.
+It usually is used with
+.B extern
+keyword like
+.PP
+.EX
+ extern struct el_options log_foobar;
+ #define EL_OPTIONS_OBJECT &log_foobar
+.EE
+.PP
It is real pain in the ass to provide information about file in every print
function. For that matter very simple macros have been provided.
.PP
@@ -337,6 +372,18 @@ standards.
All side effects (like from calling function or incrementing variable in print
function call) will take effect always regardless of set logging level.
Also strings used in functions will be compiled and put into binary - always.
+If user defines
+.B NOFINFO
+in his project, all
+.B __FILE__
+and
+.B __LINE__
+will be unconditionally set to
+.B NULL
+and
+.B 0
+and no file information will be printed - even if it was enabled with
+.BR el_options (3).
.PP
If user has access to
.B c99
diff --git a/readme.md b/readme.md
index d1e83c7..a611524 100644
--- a/readme.md
+++ b/readme.md
@@ -5,16 +5,17 @@ About
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
+smaller binary. Amount of needed stack memory can be lowered by adjusting
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:
- * syslog
+ * syslog (very limited, works on *nuttx* for now)
* directly to serial device (like /dev/ttyS0)
* standard error (stderr)
* file (with optional log rotate, and syncing to prevent data loss)
+ * automatic file reopening on unexpected events (file deletion, SD remount)
* custom routine - can be anything **embedlog** just calls custom function
with string to print
* appending timestamp to every message
@@ -22,10 +23,12 @@ Implemented features are:
* time_t
* CLOCK_REALTIME (requires POSIX)
* CLOCK_MONOTONIC (requires POSIX)
+ * configurable precision of fraction of seconds (mili, micro, nano)
* print location of printed log (file and line)
* 8 predefinied log levels (total rip off from syslog(2))
* colorful output (ansi colors) for easy error spotting
* print memory block in wireshark-like output
+* fully binary logs with binary data (like CAN frames) to save space
Almost all of these features can be disabled to save some precious bytes of
memory.
@@ -61,6 +64,7 @@ architectures. No exceptions.
operating system tests
----------------------
+* arm-cortex-m4-nuttx (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]
@@ -133,8 +137,9 @@ neccessary to change on big operating systems such as **linux** or **freebsd**,
it may come in handy when compiling for very small embedded systems. All options
are passed to configure script in common way **./configure --enable-_feature_**.
Run **./configure --help** to see help on that matter. For all **--enable**
-options it is also valid to pass **--disable**. All enabled options can be later
-disabled in runtime.
+options it is also valid to pass **--disable**. Enabling option here does not
+mean it will be hard enabled in runtime, this will just give you an option to
+enable these settings later in runtime.
--enable-out-stderr (default: enable)
-------------------------------------
@@ -156,20 +161,49 @@ Allows to pas own function which will receive fully constructed message to print
as **const char \***. Usefull when there is no output facility that suits your
needs.
---enable-timestamp
-------------------
+--enable-timestamp (default: enable)
+------------------------------------
When enabled, logger will be able to add timestamp to every message. Timestamp
can be in short or long format and timer source can be configured. Check out
[man page](http://embedlog.kurwinet.pl/manuals/el_option.3.html) to read more
about it.
+--enable-fractions (default: enable)
+------------------------------------
+
+When enabled, logger will be able to add fractions of seconds to each message.
+Fractions are added after reguler timestamp in format ".mmm" where mmm is
+fractions of seconds in milliseconds. This can be tuned to use micro or even
+nanoseconds - if system has such resolution.
+
--enable-realtime, --enable-monotonic (default: enable)
-------------------------------------------------------
Allows to use better precision timers - **CLOCK_REALTIME** and
**CLOCK_MONOTONIC** but requires **POSIX**
+--enable-clock (default: enable)
+--------------------------------
+
+Allows logger to use clock(3) as time source
+
+--enable-binary-logs (default: disable)
+---------------------------------------
+
+This will allow you to log binary data (like data read from CAN). Such logs
+cannot be read with ordinary *cat* or *less* and will ned custom-made log
+decoder, but such logs will use much less space on block devices. This of
+course can be used with file rotation. This doesn't work with *stderr* or
+*syslog* output as it would make no sense to send binary data there
+
+--enable-prefix (default: enable)
+---------------------------------
+
+This will allow user to add custom string prefix to each message printed.
+Very usefull when multiple programs logs to single source (like *syslog* or
+*stderr*, it's easier to distinguish who sent that log. It's also usefull
+when you want to merge logs from multiple files into on big file of logs.
--enable-finfo (default: enable)
--------------------------------
@@ -183,6 +217,13 @@ will be added to each message.
If enabled, output logs can be colored depending on their level. Good for
quick error spotting.
+--enable-colors-extended (default: disable)
+-------------------------------------------
+
+When enable, *embedlog* will use more colors for some log levels. Without that
+some log levels will have same output color. Not all terminals/tools supports
+extended colors.
+
--enable-reentrant (default: enable)
------------------------------------