From 35982a0ae72eca31edb1b99c20337cb1027c54a4 Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Tue, 15 Apr 2025 01:40:50 +0300 Subject: [PATCH] wip --- internal/logger/hclog.go | 12 ++++++++---- pkg/build/main_build.go | 3 --- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/internal/logger/hclog.go b/internal/logger/hclog.go index 5b55765..a00b747 100644 --- a/internal/logger/hclog.go +++ b/internal/logger/hclog.go @@ -57,11 +57,15 @@ func (a *HCLoggerAdapter) Log(level hclog.Level, msg string, args ...interface{} } } - /* - * Start ugly hacks - */ + // Start ugly hacks + // Ignore exit messages + // - https://github.com/hashicorp/go-plugin/issues/331 + // - https://github.com/hashicorp/go-plugin/issues/203 + // - https://github.com/hashicorp/go-plugin/issues/192 var chLogLevel chLog.Level - if msg == "plugin process exited" || strings.HasPrefix(msg, "[DEBUG] plugin") { + if msg == "plugin process exited" || + msg == "[ERR] plugin: stream copy 'stderr' error: stream closed" || + strings.HasPrefix(msg, "[DEBUG] plugin") { chLogLevel = chLog.DebugLevel } else { chLogLevel = hclogLevelTochLog(level) diff --git a/pkg/build/main_build.go b/pkg/build/main_build.go index 702e130..98a6b28 100644 --- a/pkg/build/main_build.go +++ b/pkg/build/main_build.go @@ -19,7 +19,6 @@ package build import ( "log/slog" "sync" - "syscall" "gitea.plemya-x.ru/Plemya-x/ALR/internal/utils" "gitea.plemya-x.ru/Plemya-x/ALR/pkg/manager" @@ -90,7 +89,5 @@ func NewMainBuilder( repos: repos, } - slog.Warn("uid", "uid", syscall.Getuid(), "gid", syscall.Getgid()) - return builder, cleanup, nil }