aboutgitcodebugslistschat
path: root/log.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-10-10 10:35:47 +0200
committerStefano Brivio <sbrivio@redhat.com>2022-10-15 02:10:28 +0200
commite23024ccfff661ad5aee7c122a1833a103fbb971 (patch)
tree141f6d4bdb54532dc469bab272a2c945e12612c9 /log.c
parent2074b332f9c6d533c7adb46491b3a4b7461cc110 (diff)
downloadpasst-e23024ccfff661ad5aee7c122a1833a103fbb971.tar
passt-e23024ccfff661ad5aee7c122a1833a103fbb971.tar.gz
passt-e23024ccfff661ad5aee7c122a1833a103fbb971.tar.bz2
passt-e23024ccfff661ad5aee7c122a1833a103fbb971.tar.lz
passt-e23024ccfff661ad5aee7c122a1833a103fbb971.tar.xz
passt-e23024ccfff661ad5aee7c122a1833a103fbb971.tar.zst
passt-e23024ccfff661ad5aee7c122a1833a103fbb971.zip
conf, log, Makefile: Add versioning information
Add a --version option displaying that, and also include this information in the log files. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'log.c')
-rw-r--r--log.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/log.c b/log.c
index 993c617..468c730 100644
--- a/log.c
+++ b/log.c
@@ -172,7 +172,7 @@ void passt_vsyslog(int pri, const char *format, va_list ap)
}
/**
- * logfile_init() - Open log file and write header with PID and path
+ * logfile_init() - Open log file and write header with PID, version, path
* @name: Identifier for header: passt or pasta
* @path: Path to log file
* @size: Maximum size of log file: log_cut_size is calculatd here
@@ -196,7 +196,7 @@ void logfile_init(const char *name, const char *path, size_t size)
log_size = size ? size : LOGFILE_SIZE_DEFAULT;
- n = snprintf(log_header, sizeof(log_header), "%s: %s (%i)",
+ n = snprintf(log_header, sizeof(log_header), "%s " VERSION ": %s (%i)",
name, exe, getpid());
if (write(log_file, log_header, n) <= 0 ||