From 3b25f9d762a305347f34d3da0a7328ee193c412c Mon Sep 17 00:00:00 2001 From: David O'Sullivan Date: Wed, 17 May 2023 10:29:15 +0100 Subject: [PATCH 1/2] Adds detection logging messages at info level --- tomcat/detect.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tomcat/detect.go b/tomcat/detect.go index 7e6f60b..aeaf11f 100644 --- a/tomcat/detect.go +++ b/tomcat/detect.go @@ -48,7 +48,7 @@ func (d Detect) Detect(context libcnb.DetectContext) (libcnb.DetectResult, error appServer, _ := cr.Resolve("BP_JAVA_APP_SERVER") if appServer != "" && appServer != JavaAppServerTomcat { - d.Logger.Debugf("failed to match requested app server of [%s], buildpack supports [%s]", appServer, JavaAppServerTomcat) + d.Logger.Infof("SKIPPED: buildpack does not match requested app server of [%s], buildpack supports [%s]", appServer, JavaAppServerTomcat) return libcnb.DetectResult{Pass: false}, nil } @@ -58,6 +58,7 @@ func (d Detect) Detect(context libcnb.DetectContext) (libcnb.DetectResult, error } if _, ok := m.Get("Main-Class"); ok { + d.Logger.Info("SKIPPED: Manifest attribute 'Main-Class' was found") return libcnb.DetectResult{Pass: false}, nil } From 649034b1b814e3244de54c5e949c9bd6917a421b Mon Sep 17 00:00:00 2001 From: David O'Sullivan Date: Thu, 18 May 2023 15:05:10 +0100 Subject: [PATCH 2/2] Adds logger to ConfigurationResolver & extra log message --- tomcat/detect.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tomcat/detect.go b/tomcat/detect.go index aeaf11f..736655c 100644 --- a/tomcat/detect.go +++ b/tomcat/detect.go @@ -41,7 +41,7 @@ type Detect struct { } func (d Detect) Detect(context libcnb.DetectContext) (libcnb.DetectResult, error) { - cr, err := libpak.NewConfigurationResolver(context.Buildpack, nil) + cr, err := libpak.NewConfigurationResolver(context.Buildpack, &d.Logger) if err != nil { return libcnb.DetectResult{}, fmt.Errorf("unable to create configuration resolver\n%w", err) } @@ -85,6 +85,7 @@ func (d Detect) Detect(context libcnb.DetectContext) (libcnb.DetectResult, error if _, err := os.Stat(file); err != nil && !os.IsNotExist(err) { return libcnb.DetectResult{}, fmt.Errorf("unable to stat file %s\n%w", file, err) } else if os.IsNotExist(err) { + d.Logger.Info("PASSED: a WEB-INF directory was not found, this is normal when building from source") return result, nil }