diff options
author | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2019-03-01 00:08:35 +0100 |
---|---|---|
committer | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2019-03-01 00:12:51 +0100 |
commit | 4b55625fc6390ac995d380cc2f9c081e8a568164 (patch) | |
tree | aff3471bb0a74b2d6c99ab29ae6dcc74d8ccca71 /examples | |
parent | edb6e57cc47477e3ed40a6adb7ff63b7b8f24e86 (diff) | |
download | embedlog-4b55625fc6390ac995d380cc2f9c081e8a568164.tar.gz embedlog-4b55625fc6390ac995d380cc2f9c081e8a568164.tar.bz2 embedlog-4b55625fc6390ac995d380cc2f9c081e8a568164.zip |
ABI/API change: add printing function name with logs
only on c99+ compilers
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/print-options.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/print-options.c b/examples/print-options.c index abfb05c..4af370f 100644 --- a/examples/print-options.c +++ b/examples/print-options.c @@ -7,6 +7,13 @@ #define EL_OPTIONS_OBJECT &opts +void like_this() { el_print(ELN, "yup, I really like this!"); } +void or_this() { el_print(ELN, "this I like too"); } +void too_long_function_to_present_trimming_but_it_could_be_impossible() +{ + el_print(ELN, "trimmed (I hope) function name"); +} + int main(void) { struct el_options opts; @@ -47,6 +54,12 @@ int main(void) el_print(ELF, "no time information, if your heart desire it"); el_option(EL_TS_FRACT, EL_TS_FRACT_NS); + el_option(EL_FUNCINFO, 1); + el_print(ELN, "logs can contain function name from which they were called"); + like_this(); + or_this(); + too_long_function_to_present_trimming_but_it_could_be_impossible(); + el_option(EL_FINFO, 1); el_print(ELF, "log location is very usefull for debuging"); |