Skip to content

Commit 64d1ce9

Browse files
committed
remove old system artifacts
1 parent 68c9f74 commit 64d1ce9

File tree

4 files changed

+6
-51
lines changed

4 files changed

+6
-51
lines changed

backend/controllers/github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ func handlePushEvent(ctx context.Context, gh utils.GithubClientProvider, payload
441441
if repoCacheEnabled == "1" && strings.HasSuffix(ref, defaultBranch) {
442442
go func(ctx context.Context) {
443443
if err := sendProcessCacheRequest(repoFullName, defaultBranch, installationId); err != nil {
444-
logging.Error("Failed to process cache request", map[string]any{
444+
slog.Error("Failed to process cache request", map[string]any{
445445
"error": err,
446446
"repo_full_name": repoFullName,
447447
})

backend/controllers/projects.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ func (d DiggerController) SetJobStatusForProject(c *gin.Context) {
793793
}()
794794
defer logging.InheritRequestLogger(ctx)()
795795

796-
logging.Debug("Starting post-success job processing", "job_id", jobId)
796+
slog.Debug("Starting post-success job processing", "job_id", jobId)
797797

798798
ghClientProvider := d.GithubClientProvider
799799
installationLink, err := models.DB.GetGithubInstallationLinkForOrg(orgId)

backend/logging/context_logger.go

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -224,51 +224,10 @@ func InheritRequestLogger(ctx context.Context) (cleanup func()) {
224224
return func() {}
225225
}
226226

227-
// Smart logging functions that can handle multiple signatures
228-
// These are the ONLY logging functions we need - they handle all cases
229-
func Info(msg string, args ...any) {
230-
ctx, attrs := parseLogArgs(args...)
231-
if ctx != nil {
232-
From(ctx).Info(msg, attrs...)
233-
} else if logger := getGoroutineLogger(); logger != nil {
234-
logger.Info(msg, attrs...)
235-
} else {
236-
slog.Info(msg, attrs...)
237-
}
238-
}
239227

240-
func Error(msg string, args ...any) {
241-
ctx, attrs := parseLogArgs(args...)
242-
if ctx != nil {
243-
From(ctx).Error(msg, attrs...)
244-
} else if logger := getGoroutineLogger(); logger != nil {
245-
logger.Error(msg, attrs...)
246-
} else {
247-
slog.Error(msg, attrs...)
248-
}
249-
}
250228

251-
func Debug(msg string, args ...any) {
252-
ctx, attrs := parseLogArgs(args...)
253-
if ctx != nil {
254-
From(ctx).Debug(msg, attrs...)
255-
} else if logger := getGoroutineLogger(); logger != nil {
256-
logger.Debug(msg, attrs...)
257-
} else {
258-
slog.Debug(msg, attrs...)
259-
}
260-
}
261229

262-
func Warn(msg string, args ...any) {
263-
ctx, attrs := parseLogArgs(args...)
264-
if ctx != nil {
265-
From(ctx).Warn(msg, attrs...)
266-
} else if logger := getGoroutineLogger(); logger != nil {
267-
logger.Warn(msg, attrs...)
268-
} else {
269-
slog.Warn(msg, attrs...)
270-
}
271-
}
230+
272231

273232
// parseLogArgs intelligently parses variadic arguments to extract context and attributes
274233
func parseLogArgs(args ...any) (context.Context, []any) {
@@ -303,7 +262,3 @@ func parseLogArgs(args ...any) (context.Context, []any) {
303262
return ctx, attrs
304263
}
305264

306-
// Backward compatibility functions (optional - can be removed if not needed)
307-
func InfoMsg(msg string, attrs ...any) { slog.Default().Info(msg, attrs...) }
308-
func ErrorMsg(msg string, attrs ...any) { slog.Default().Error(msg, attrs...) }
309-
func DebugMsg(msg string, attrs ...any) { slog.Default().Debug(msg, attrs...) }

backend/models/setup.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func ConnectDatabase() {
3636
Logger: glogger,
3737
})
3838
if err != nil {
39-
logging.Error("Failed to connect to database", "error", err)
39+
slog.Error("Failed to connect to database", "error", err)
4040
panic("Failed to connect to database!")
4141
}
4242

@@ -45,10 +45,10 @@ func ConnectDatabase() {
4545
// data and fixtures added
4646
orgNumberOne, err := DB.GetOrganisation(DEFAULT_ORG_NAME)
4747
if orgNumberOne == nil {
48-
logging.Info("No default organization found, creating default organisation", "name", DEFAULT_ORG_NAME)
48+
slog.Info("No default organization found, creating default organisation", "name", DEFAULT_ORG_NAME)
4949
_, err := DB.CreateOrganisation("digger", "", DEFAULT_ORG_NAME)
5050
if err != nil {
51-
logging.Error("Failed to create default organization", "error", err)
51+
slog.Error("Failed to create default organization", "error", err)
5252
}
5353
}
5454
}

0 commit comments

Comments
 (0)