aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Łyszczek <michal.lyszczek@bofc.pl>2018-01-24 17:46:48 +0100
committerMichał Łyszczek <michal.lyszczek@bofc.pl>2018-01-24 17:46:48 +0100
commit67ec9f6de34b995a0bcd57963a02d2d6ed3eaac5 (patch)
tree372f1f0697d39968fd738270b1f62c2b8a94e1e8
parent4341b5574f02b295a308818711b15f0571cfed82 (diff)
downloadembedlog-67ec9f6de34b995a0bcd57963a02d2d6ed3eaac5.tar.gz
embedlog-67ec9f6de34b995a0bcd57963a02d2d6ed3eaac5.tar.bz2
embedlog-67ec9f6de34b995a0bcd57963a02d2d6ed3eaac5.zip
change: remove _OPT_ from options after removing it from embedlog.h
-rw-r--r--examples/print-memory.c4
-rw-r--r--examples/print-options.c36
-rw-r--r--examples/print-simple.c6
-rw-r--r--examples/print-to-file.c19
4 files changed, 33 insertions, 32 deletions
diff --git a/examples/print-memory.c b/examples/print-memory.c
index 8f2f30e..b4c5ce9 100644
--- a/examples/print-memory.c
+++ b/examples/print-memory.c
@@ -3,7 +3,7 @@
Author: Michał Łyszczek <michal.lyszczek@bofc.pl>
========================================================================== */
-#include <embedlog.h>
+#include "embedlog.h"
int main(void)
{
@@ -19,7 +19,7 @@ int main(void)
}
el_init();
- el_option(EL_OPT_OUT, EL_OPT_OUT_STDERR);
+ el_option(EL_OUT, EL_OUT_STDERR);
el_pmemory(ELI, ascii, sizeof(ascii));
el_pmemory(ELI, s, sizeof(s));
diff --git a/examples/print-options.c b/examples/print-options.c
index d01306d..c9e02c0 100644
--- a/examples/print-options.c
+++ b/examples/print-options.c
@@ -3,48 +3,48 @@
Author: Michał Łyszczek <michal.lyszczek@bofc.pl>
========================================================================== */
-#include <embedlog.h>
+#include "embedlog.h"
int main(void)
{
el_init();
- el_option(EL_OPT_OUT, EL_OPT_OUT_STDERR);
+ el_option(EL_OUT, EL_OUT_STDERR);
- el_option(EL_OPT_PRINT_LEVEL, 0);
+ el_option(EL_PRINT_LEVEL, 0);
el_print(ELI, "We can disable information about log level");
el_print(ELF, "message still will be filtered by log level");
el_print(ELA, "but there is no way to tell what level message is");
el_print(ELD, "like this message will not be printed");
- el_option(EL_OPT_TS, EL_OPT_TS_SHORT);
+ el_option(EL_TS, EL_TS_SHORT);
el_print(ELF, "As every respected logger, we also have timestamps");
el_print(ELF, "which work well with time from clock()");
- el_option(EL_OPT_TS_TM, EL_OPT_TS_TM_MONOTONIC);
+ el_option(EL_TS_TM, EL_TS_TM_MONOTONIC);
el_print(ELF, "or CLOCK_MONOTONIC from POSIX");
- el_option(EL_OPT_TS, EL_OPT_TS_LONG);
- el_option(EL_OPT_TS_TM, EL_OPT_TS_TM_TIME);
+ el_option(EL_TS, EL_TS_LONG);
+ el_option(EL_TS_TM, EL_TS_TM_TIME);
el_print(ELF, "we also have long format that works well with time()");
- el_option(EL_OPT_TS_TM, EL_OPT_TS_TM_REALTIME);
+ el_option(EL_TS_TM, EL_TS_TM_REALTIME);
el_print(ELF, "if higher precision is needed we can use CLOCK_REALTIME");
- el_option(EL_OPT_TS, EL_OPT_TS_SHORT);
+ el_option(EL_TS, EL_TS_SHORT);
el_print(ELF, "we can also mix REALTIME with short format");
- el_option(EL_OPT_TS, EL_OPT_TS_LONG);
- el_option(EL_OPT_TS_TM, EL_OPT_TS_TM_CLOCK);
+ el_option(EL_TS, EL_TS_LONG);
+ el_option(EL_TS_TM, EL_TS_TM_CLOCK);
el_print(ELF, "or long with clock() if you desire");
- el_option(EL_OPT_TS, EL_OPT_TS_OFF);
+ el_option(EL_TS, EL_TS_OFF);
el_print(ELF, "no time information, if your heart desire it");
- el_option(EL_OPT_FINFO, 1);
+ el_option(EL_FINFO, 1);
el_print(ELF, "log location is very usefull for debuging");
- el_option(EL_OPT_TS, EL_OPT_TS_LONG);
- el_option(EL_OPT_TS_TM, EL_OPT_TS_TM_REALTIME);
- el_option(EL_OPT_PRINT_LEVEL, 1);
+ el_option(EL_TS, EL_TS_LONG);
+ el_option(EL_TS_TM, EL_TS_TM_REALTIME);
+ el_option(EL_PRINT_LEVEL, 1);
el_print(ELF, "Different scenarios need different options");
el_print(ELA, "So we can mix options however we want");
- el_option(EL_OPT_COLORS, 1);
- el_option(EL_OPT_LEVEL, EL_DBG);
+ el_option(EL_COLORS, 1);
+ el_option(EL_LEVEL, EL_DBG);
el_print(ELD, "And if we have");
el_print(ELI, "modern terminal");
el_print(ELN, "we can enable colors");
diff --git a/examples/print-simple.c b/examples/print-simple.c
index 0c080ca..d3b3956 100644
--- a/examples/print-simple.c
+++ b/examples/print-simple.c
@@ -3,7 +3,7 @@
Author: Michał Łyszczek <michal.lyszczek@bofc.pl>
========================================================================== */
-#include <embedlog.h>
+#include "embedlog.h"
int main(void)
{
@@ -18,7 +18,7 @@ int main(void)
* will be printed to /dev/null
*/
- el_option(EL_OPT_OUT, EL_OPT_OUT_STDERR);
+ el_option(EL_OUT, EL_OUT_STDERR);
/*
* now we can simply print messages like we would do it with ordinary
@@ -34,7 +34,7 @@ int main(void)
* prints
*/
- el_option(EL_OPT_LEVEL, EL_DBG);
+ el_option(EL_LEVEL, EL_DBG);
el_print(ELD, "But now debug will be printed");
/*
diff --git a/examples/print-to-file.c b/examples/print-to-file.c
index e6e7802..aa2418e 100644
--- a/examples/print-to-file.c
+++ b/examples/print-to-file.c
@@ -3,19 +3,20 @@
Author: Michał Łyszczek <michal.lyszczek@bofc.pl>
========================================================================== */
-#include <embedlog.h>
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
+#include "embedlog.h"
+
#define WORKDIR "/tmp/embedlog-example"
int main(void)
{
el_init();
- el_option(EL_OPT_TS, EL_OPT_TS_LONG);
- el_option(EL_OPT_TS_TM, EL_OPT_TS_TM_REALTIME);
- el_option(EL_OPT_FINFO, 1);
+ el_option(EL_TS, EL_TS_LONG);
+ el_option(EL_TS_TM, EL_TS_TM_REALTIME);
+ el_option(EL_FINFO, 1);
if (mkdir(WORKDIR, 0755) != 0 && errno != EEXIST)
{
@@ -25,7 +26,7 @@ int main(void)
goto error;
}
- if (el_option(EL_OPT_FNAME, WORKDIR"/log") != 0)
+ if (el_option(EL_FNAME, WORKDIR"/log") != 0)
{
/*
* embedlog will try to open file now, this may fail for various of
@@ -43,7 +44,7 @@ int main(void)
* instruct logger to print into both file and standard error
*/
- el_option(EL_OPT_OUT, EL_OPT_OUT_FILE | EL_OPT_OUT_STDERR);
+ el_option(EL_OUT, EL_OUT_FILE | EL_OUT_STDERR);
el_print(ELI, "This message will appear both in standard error");
el_print(ELI, "and in file %s", WORKDIR"/log");
@@ -57,12 +58,12 @@ int main(void)
* higher to prevent unnecessary rotation
*/
- el_option(EL_OPT_FROTATE_NUMBER, 5);
- el_option(EL_OPT_FROTATE_SIZE, 512);
+ el_option(EL_FROTATE_NUMBER, 5);
+ el_option(EL_FROTATE_SIZE, 512);
el_print(ELI, "Now we enabled log rotation");
el_print(ELI, "If log cannot fit in current file");
el_print(ELI, "it will be stored in new file");
- el_print(ELI, "and if library creates EL_OPT_FROTATE_NUMBER files");
+ el_print(ELI, "and if library creates EL_FROTATE_NUMBER files");
el_print(ELI, "oldest file will be deleted and new file will be created");
el_print(ELI, "run this program multiple times and see how it works");