logs refactoring

This commit is contained in:
Gani Georgiev
2023-11-26 13:33:17 +02:00
parent ff5535f4de
commit 821aae4a62
109 changed files with 7320 additions and 3728 deletions
+7 -3
View File
@@ -5,8 +5,8 @@ import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"log/slog"
"net/http"
"os"
"os/exec"
@@ -120,8 +120,12 @@ func cronBinds(app core.App, loader *goja.Runtime, executors *vmsPool) {
return err
})
if err != nil && app.IsDebug() {
fmt.Println("[cronAdd] failed to execute cron job " + jobId + ": " + err.Error())
if err != nil {
app.Logger().Debug(
"[cronAdd] failed to execute cron job",
slog.String("jobId", jobId),
slog.String("error", err.Error()),
)
}
})
if err != nil {