From ee0269dad5dd2adb33eb912f8af4b16a199710a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 12:43:54 +0000 Subject: [PATCH 1/2] build(deps): bump github.com/charmbracelet/log from 0.2.4 to 0.3.1 Bumps [github.com/charmbracelet/log](https://github.com/charmbracelet/log) from 0.2.4 to 0.3.1. - [Release notes](https://github.com/charmbracelet/log/releases) - [Commits](https://github.com/charmbracelet/log/compare/v0.2.4...v0.3.1) --- updated-dependencies: - dependency-name: github.com/charmbracelet/log dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 5493d5b..6ad08b6 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/charmbracelet/lipgloss v0.9.1 - github.com/charmbracelet/log v0.2.4 + github.com/charmbracelet/log v0.3.1 github.com/fsnotify/fsnotify v1.7.0 github.com/go-co-op/gocron v1.34.0 github.com/kitabisa/teler-waf v1.2.3 @@ -76,7 +76,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect + golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.10.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/go.sum b/go.sum index 0e87059..8bb1f39 100644 --- a/go.sum +++ b/go.sum @@ -207,8 +207,8 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/charmbracelet/lipgloss v0.9.1 h1:PNyd3jvaJbg4jRHKWXnCj1akQm4rh8dbEzN1p/u1KWg= github.com/charmbracelet/lipgloss v0.9.1/go.mod h1:1mPmG4cxScwUQALAAnacHaigiiHB9Pmr+v1VEawJl6I= -github.com/charmbracelet/log v0.2.4 h1:3pKtq5/Y5QMKtcZt7kDqD1p9w7lICzHYQACBFY4ocHA= -github.com/charmbracelet/log v0.2.4/go.mod h1:nQGK8tvc4pS9cvVEH/pWJiZ50eUq1aoXUOjGpXvdD0k= +github.com/charmbracelet/log v0.3.1 h1:TjuY4OBNbxmHWSwO3tosgqs5I3biyY8sQPny/eCMTYw= +github.com/charmbracelet/log v0.3.1/go.mod h1:OR4E1hutLsax3ZKpXbgUqPtTjQfrh1pG3zwHGWuuq8g= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -531,8 +531,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= -golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= From 2134a691756b1ae791e9b2ab18a7f9616ea31522 Mon Sep 17 00:00:00 2001 From: Dwi Siswanto Date: Tue, 16 Jan 2024 04:12:58 +0700 Subject: [PATCH 2/2] fix(logger): undefined `log.ValueStyles` replace with `*log.Styles` & `Logger.SetStyles` Signed-off-by: Dwi Siswanto --- internal/logger/logger.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/internal/logger/logger.go b/internal/logger/logger.go index d91e97a..68ecdbe 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -9,16 +9,21 @@ import ( ) func New() *log.Logger { - log.ValueStyles["id"] = lipgloss.NewStyle().Foreground(lipgloss.Color("86")) - log.ValueStyles["threat"] = lipgloss.NewStyle().Foreground(lipgloss.Color("192")) - log.ValueStyles["request"] = lipgloss.NewStyle().Foreground(lipgloss.Color("204")) - log.ValueStyles["options"] = log.ValueStyles["threat"] - - return log.NewWithOptions( + logger := log.NewWithOptions( colorable.NewColorableStderr(), log.Options{ ReportTimestamp: true, TimeFormat: time.DateTime, }, ) + + styles := log.DefaultStyles() + styles.Values["id"] = lipgloss.NewStyle().Foreground(lipgloss.Color("86")) + styles.Values["threat"] = lipgloss.NewStyle().Foreground(lipgloss.Color("192")) + styles.Values["request"] = lipgloss.NewStyle().Foreground(lipgloss.Color("204")) + styles.Values["options"] = styles.Values["threat"] + + logger.SetStyles(styles) + + return logger }