aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/api/malsync/malsync.go2
-rw-r--r--utils/logger/logger.go4
2 files changed, 2 insertions, 4 deletions
diff --git a/utils/api/malsync/malsync.go b/utils/api/malsync/malsync.go
index 1ee479c..9509707 100644
--- a/utils/api/malsync/malsync.go
+++ b/utils/api/malsync/malsync.go
@@ -88,7 +88,6 @@ func (c *client) makeRequest(ctx context.Context, url string) ([]byte, error) {
switch response.StatusCode {
case http.StatusNotFound:
- // Not found is not an error, return nil
return nil, nil
case http.StatusTooManyRequests:
retryAfter := c.getRetryAfterDuration(response)
@@ -131,7 +130,6 @@ func GetAnimeByMALID(malID int) (*types.MalsyncAnimeResponse, error) {
return nil, errors.New("failed to fetch anime data from Malsync API")
}
- // Handle 404 case where makeRequest returns nil, nil
if bytes == nil {
return nil, nil
}
diff --git a/utils/logger/logger.go b/utils/logger/logger.go
index 41e7f1e..f1c94e7 100644
--- a/utils/logger/logger.go
+++ b/utils/logger/logger.go
@@ -131,7 +131,7 @@ func log(levelLabel LogLevel, zapLevel zapcore.Level, prefix string, msg any) {
message := fmt.Sprint(msg)
colored := colorMessage(levelLabel, message)
+ fullMessage := formatPrefix(prefix) + colored
- loggerInstance.Check(zapLevel, colored).
- Write(zap.String("prefix", formatPrefix(prefix)))
+ loggerInstance.Log(zapLevel, fullMessage)
}