From 07896b97c50d6241c5955c8767a28fd0a9e4c389 Mon Sep 17 00:00:00 2001
From: Ian Howell <ian.howell0@gmail.com>
Date: Fri, 1 May 2020 12:08:29 -0500
Subject: [PATCH] Add a prefix to the logger

This will make it easier to differentiate between airship log messages
and third-party log message (e.g. clusterctl)

Change-Id: I0b8a2fed58a6a673277f511267e2498c7e8d4c1b
---
 pkg/log/log.go      | 2 +-
 pkg/log/log_test.go | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkg/log/log.go b/pkg/log/log.go
index 9fa57aa80..e0322d3cd 100644
--- a/pkg/log/log.go
+++ b/pkg/log/log.go
@@ -22,7 +22,7 @@ import (
 
 var (
 	debug      = false
-	airshipLog = log.New(os.Stderr, "", log.LstdFlags)
+	airshipLog = log.New(os.Stderr, "[airshipctl] ", log.LstdFlags)
 )
 
 // Init initializes settings related to logging
diff --git a/pkg/log/log_test.go b/pkg/log/log_test.go
index f43baa906..cb134eec9 100644
--- a/pkg/log/log_test.go
+++ b/pkg/log/log_test.go
@@ -25,9 +25,9 @@ import (
 	"opendev.org/airship/airshipctl/pkg/log"
 )
 
-var logFormatRegex = regexp.MustCompile(`^\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} .*`)
+var logFormatRegex = regexp.MustCompile(`^\[airshipctl\] \d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} .*`)
 
-const prefixLength = len("2001/02/03 16:05:06 ")
+const prefixLength = len("[airshipctl] 2001/02/03 16:05:06 ")
 
 func TestLoggingPrintf(t *testing.T) {
 	assert := assert.New(t)