From fa20f603834ef9febe396c058c9d775038f4a28b Mon Sep 17 00:00:00 2001 From: PA4WDH Date: Wed, 24 May 2023 08:33:53 +0200 Subject: Add logging functions --- Makefile | 2 +- argparse.c | 22 ++++++++++++++--- cputemp2maxfreq.c | 16 ++++++++++++- cputemp2maxfreq.h | 2 ++ logger.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ logger.h | 9 +++++++ 6 files changed, 117 insertions(+), 5 deletions(-) create mode 100644 logger.c create mode 100644 logger.h diff --git a/Makefile b/Makefile index 89fc8b7..77e77c6 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -cputemp2maxfreq: version.o debug.o sysfs.o cpufreq.o failsafe.o argparse.o +cputemp2maxfreq: version.o debug.o sysfs.o cpufreq.o failsafe.o argparse.o logger.o version.h: generate_version_h.sh .git/index ./generate_version_h.sh > version.h diff --git a/argparse.c b/argparse.c index 01b6c57..7246d31 100644 --- a/argparse.c +++ b/argparse.c @@ -4,6 +4,7 @@ #include #include "cputemp2maxfreq.h" #include "debug.h" +#include "logger.h" extern struct s_config config; @@ -20,14 +21,16 @@ void printhelp() "-h Display this help text\n" "-i Input for temperature readout, usually somewhere in sysfs\n" " Default: %s\n" + "-l Logger to use, valid values: none, kmsg, stdout, syslog\n" + " Default: %s\n" "-p