From 135099d6f63e7909298f425d4ff523b30e482ea1 Mon Sep 17 00:00:00 2001 From: Tim Ramlot <42113979+inteon@users.noreply.github.com> Date: Mon, 19 Aug 2024 13:37:32 +0200 Subject: [PATCH] set log prefix in main.go instead of endpoint.go Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com> --- cmd/vcert/main.go | 4 ++++ pkg/endpoint/endpoint.go | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/vcert/main.go b/cmd/vcert/main.go index 86333ba3..57f23fff 100644 --- a/cmd/vcert/main.go +++ b/cmd/vcert/main.go @@ -35,6 +35,10 @@ var ( exit = os.Exit ) +func init() { + log.SetPrefix(UtilityShortName + ": ") +} + // UtilityName is the full name of the command-line utility const UtilityName string = "Venafi Certificate Utility" diff --git a/pkg/endpoint/endpoint.go b/pkg/endpoint/endpoint.go index a0fb40c0..e7e9621c 100644 --- a/pkg/endpoint/endpoint.go +++ b/pkg/endpoint/endpoint.go @@ -23,7 +23,6 @@ import ( "crypto/x509" "encoding/pem" "fmt" - "log" "net" "net/http" "regexp" @@ -54,7 +53,6 @@ const ( ) func init() { - log.SetPrefix("vCert: ") LocalIP = getPrimaryNetAddr() }