From 5ddc4fe32cb15cd8b3b2730345fe4d9811a2cb6d Mon Sep 17 00:00:00 2001 From: bashbunni Date: Wed, 7 Aug 2024 21:27:27 -0700 Subject: [PATCH 01/10] chore(deps): use lipgloss alpha branch --- go.mod | 6 +++--- go.sum | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1c92323..9ca424d 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/charmbracelet/log go 1.19 require ( - github.com/charmbracelet/lipgloss v0.12.1 + github.com/charmbracelet/lipgloss v0.12.2-0.20240722162534-2390dea254e8 github.com/go-logfmt/logfmt v0.6.0 github.com/muesli/termenv v0.15.2 github.com/stretchr/testify v1.9.0 @@ -16,9 +16,9 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect - golang.org/x/sys v0.19.0 // indirect + golang.org/x/sys v0.23.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 2222caf..f3a8642 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,8 @@ github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiE github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/charmbracelet/lipgloss v0.12.1 h1:/gmzszl+pedQpjCOH+wFkZr/N90Snz40J/NR7A0zQcs= github.com/charmbracelet/lipgloss v0.12.1/go.mod h1:V2CiwIuhx9S1S1ZlADfOj9HmxeMAORuz5izHb0zGbB8= +github.com/charmbracelet/lipgloss v0.12.2-0.20240722162534-2390dea254e8 h1:7SMpm8y17K515kM1Q/tiOrSm1jb3hJh94W+LXHWKv+U= +github.com/charmbracelet/lipgloss v0.12.2-0.20240722162534-2390dea254e8/go.mod h1:LCQCsVTQm+lcQLFSiHwSvQUqRXtry1v/2KCfKxdsCeY= github.com/charmbracelet/x/ansi v0.1.4 h1:IEU3D6+dWwPSgZ6HBH+v6oUuZ/nVawMiWj5831KfiLM= github.com/charmbracelet/x/ansi v0.1.4/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -14,6 +16,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -28,6 +32,8 @@ golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQz golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From 8ee8d2a16cfc7990372a5989318c1522e3d40e13 Mon Sep 17 00:00:00 2001 From: bashbunni Date: Wed, 7 Aug 2024 22:55:59 -0700 Subject: [PATCH 02/10] refactor: first commit where the program runs... failing tests --- go.mod | 11 +++++++++-- go.sum | 25 +++++++++++++++++-------- logger.go | 15 ++++++++------- pkg.go | 4 ++-- pkg_test.go | 4 ++-- styles.go | 1 + text.go | 28 ++++++++++++++-------------- text_test.go | 19 +++++++++---------- 8 files changed, 62 insertions(+), 45 deletions(-) diff --git a/go.mod b/go.mod index 9ca424d..72cb25b 100644 --- a/go.mod +++ b/go.mod @@ -4,21 +4,28 @@ go 1.19 require ( github.com/charmbracelet/lipgloss v0.12.2-0.20240722162534-2390dea254e8 + github.com/charmbracelet/shampoo v0.0.0-20240807160433-2fdf07ab2f73 github.com/go-logfmt/logfmt v0.6.0 - github.com/muesli/termenv v0.15.2 github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20231006140011-7918f672742d ) require ( github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect - github.com/charmbracelet/x/ansi v0.1.4 // indirect + github.com/charmbracelet/x/ansi v0.1.5-0.20240807160011-7b9bd9980386 // indirect + github.com/charmbracelet/x/input v0.1.3 // indirect + github.com/charmbracelet/x/term v0.1.1 // indirect + github.com/charmbracelet/x/windows v0.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect + github.com/muesli/cancelreader v0.2.2 // indirect + github.com/muesli/termenv v0.15.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect + github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect golang.org/x/sys v0.23.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f3a8642..1caeb67 100644 --- a/go.sum +++ b/go.sum @@ -1,23 +1,31 @@ github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= -github.com/charmbracelet/lipgloss v0.12.1 h1:/gmzszl+pedQpjCOH+wFkZr/N90Snz40J/NR7A0zQcs= -github.com/charmbracelet/lipgloss v0.12.1/go.mod h1:V2CiwIuhx9S1S1ZlADfOj9HmxeMAORuz5izHb0zGbB8= github.com/charmbracelet/lipgloss v0.12.2-0.20240722162534-2390dea254e8 h1:7SMpm8y17K515kM1Q/tiOrSm1jb3hJh94W+LXHWKv+U= github.com/charmbracelet/lipgloss v0.12.2-0.20240722162534-2390dea254e8/go.mod h1:LCQCsVTQm+lcQLFSiHwSvQUqRXtry1v/2KCfKxdsCeY= -github.com/charmbracelet/x/ansi v0.1.4 h1:IEU3D6+dWwPSgZ6HBH+v6oUuZ/nVawMiWj5831KfiLM= -github.com/charmbracelet/x/ansi v0.1.4/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/shampoo v0.0.0-20240807160433-2fdf07ab2f73 h1:0jbSZZFsjfd8+wAbSX5IX5iTbam8moe81Jt9vpCnxL4= +github.com/charmbracelet/shampoo v0.0.0-20240807160433-2fdf07ab2f73/go.mod h1:McJMdgyoMSHqV0p+ejH4i0jaaK5SAYUp8EgRqUjLBxI= +github.com/charmbracelet/x/ansi v0.1.5-0.20240807160011-7b9bd9980386 h1:aOjzT+GwoykWSR1HiE4nFz+2HD+M7jKa5B3jl6BZhUo= +github.com/charmbracelet/x/ansi v0.1.5-0.20240807160011-7b9bd9980386/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/x/input v0.1.3 h1:oy4TMhyGQsYs/WWJwu1ELUMFnjiUAXwtDf048fHbCkg= +github.com/charmbracelet/x/input v0.1.3/go.mod h1:1gaCOyw1KI9e2j00j/BBZ4ErzRZqa05w0Ghn83yIhKU= +github.com/charmbracelet/x/term v0.1.1 h1:3cosVAiPOig+EV4X9U+3LDgtwwAoEzJjNdwbXDjF6yI= +github.com/charmbracelet/x/term v0.1.1/go.mod h1:wB1fHt5ECsu3mXYusyzcngVWWlu1KKUmmLhfgr/Flxw= +github.com/charmbracelet/x/windows v0.1.2 h1:Iumiwq2G+BRmgoayww/qfcvof7W/3uLoelhxojXlRWg= +github.com/charmbracelet/x/windows v0.1.2/go.mod h1:GLEO/l+lizvFDBPLIOk+49gdX49L9YWMB5t+DZd0jkQ= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= +github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -27,11 +35,12 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= +github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= 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/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/logger.go b/logger.go index f4120c1..90cc78d 100644 --- a/logger.go +++ b/logger.go @@ -11,8 +11,7 @@ import ( "sync/atomic" "time" - "github.com/charmbracelet/lipgloss" - "github.com/muesli/termenv" + "github.com/charmbracelet/shampoo" ) // ErrMissingValue is returned when a key is missing a value. @@ -26,7 +25,7 @@ type Logger struct { w io.Writer b bytes.Buffer mu *sync.RWMutex - re *lipgloss.Renderer + re *shampoo.Writer isDiscard uint32 @@ -280,9 +279,10 @@ func (l *Logger) SetOutput(w io.Writer) { atomic.StoreUint32(&l.isDiscard, isDiscard) // Reuse cached renderers if v, ok := registry.Load(w); ok { - l.re = v.(*lipgloss.Renderer) + l.re = v.(*shampoo.Writer) } else { - l.re = lipgloss.NewRenderer(w, termenv.WithColorCache(true)) + // TODO calculate background color (termenv.colorcache used to do this) + l.re = shampoo.NewWriter(w, []string{}) registry.Store(w, l.re) } } @@ -310,8 +310,9 @@ func (l *Logger) SetCallerOffset(offset int) { // SetColorProfile force sets the underlying Lip Gloss renderer color profile // for the TextFormatter. -func (l *Logger) SetColorProfile(profile termenv.Profile) { - l.re.SetColorProfile(profile) +func (l *Logger) SetColorProfile(profile shampoo.Profile) { + // TODO should shampoo have a setter for profile? + l.re.Profile = profile } // SetStyles sets the logger styles for the TextFormatter. diff --git a/pkg.go b/pkg.go index 9e083a3..de7e3e7 100644 --- a/pkg.go +++ b/pkg.go @@ -10,7 +10,7 @@ import ( "sync/atomic" "time" - "github.com/muesli/termenv" + "github.com/charmbracelet/shampoo" ) var ( @@ -140,7 +140,7 @@ func SetPrefix(prefix string) { // SetColorProfile force sets the underlying Lip Gloss renderer color profile // for the TextFormatter. -func SetColorProfile(profile termenv.Profile) { +func SetColorProfile(profile shampoo.Profile) { Default().SetColorProfile(profile) } diff --git a/pkg_test.go b/pkg_test.go index 0a4e844..afc2fbc 100644 --- a/pkg_test.go +++ b/pkg_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "github.com/muesli/termenv" + "github.com/charmbracelet/shampoo" "github.com/stretchr/testify/assert" ) @@ -82,7 +82,7 @@ func TestPrint(t *testing.T) { SetReportTimestamp(true) SetReportCaller(false) SetTimeFormat(DefaultTimeFormat) - SetColorProfile(termenv.ANSI) + SetColorProfile(shampoo.ANSI) Error("error") Print("print") assert.Equal(t, "0002/01/01 00:00:00 print\n", buf.String()) diff --git a/styles.go b/styles.go index 5a4e545..322d217 100644 --- a/styles.go +++ b/styles.go @@ -41,6 +41,7 @@ type Styles struct { // DefaultStyles returns the default styles. func DefaultStyles() *Styles { + // TODO handle this based on light/dark colors return &Styles{ Timestamp: lipgloss.NewStyle(), Caller: lipgloss.NewStyle().Faint(true), diff --git a/text.go b/text.go index c428866..972b8ed 100644 --- a/text.go +++ b/text.go @@ -26,9 +26,9 @@ func (l *Logger) writeIndent(w io.Writer, str string, indent string, newline boo _, _ = w.Write([]byte(indent)) val := escapeStringForOutput(str, false) if valueStyle, ok := st.Values[key]; ok { - val = valueStyle.Renderer(l.re).Render(val) + val = valueStyle.Render(val) } else { - val = st.Value.Renderer(l.re).Render(val) + val = st.Value.Render(val) } _, _ = w.Write([]byte(val)) if newline { @@ -40,7 +40,7 @@ func (l *Logger) writeIndent(w io.Writer, str string, indent string, newline boo _, _ = w.Write([]byte(indent)) val := escapeStringForOutput(str[:nl], false) - val = st.Value.Renderer(l.re).Render(val) + val = st.Value.Render(val) _, _ = w.Write([]byte(val)) _, _ = w.Write([]byte{'\n'}) str = str[nl+1:] @@ -176,7 +176,7 @@ func (l *Logger) textFormatter(keyvals ...interface{}) { case TimestampKey: if t, ok := keyvals[i+1].(time.Time); ok { ts := t.Format(l.timeFormat) - ts = st.Timestamp.Renderer(l.re).Render(ts) + ts = st.Timestamp.Render(ts) writeSpace(&l.b, firstKey) l.b.WriteString(ts) } @@ -188,7 +188,7 @@ func (l *Logger) textFormatter(keyvals ...interface{}) { continue } - lvl = lvlStyle.Renderer(l.re).String() + lvl = lvlStyle.String() if lvl != "" { writeSpace(&l.b, firstKey) l.b.WriteString(lvl) @@ -197,28 +197,28 @@ func (l *Logger) textFormatter(keyvals ...interface{}) { case CallerKey: if caller, ok := keyvals[i+1].(string); ok { caller = fmt.Sprintf("<%s>", caller) - caller = st.Caller.Renderer(l.re).Render(caller) + caller = st.Caller.Render(caller) writeSpace(&l.b, firstKey) l.b.WriteString(caller) } case PrefixKey: if prefix, ok := keyvals[i+1].(string); ok { - prefix = st.Prefix.Renderer(l.re).Render(prefix + ":") + prefix = st.Prefix.Render(prefix + ":") writeSpace(&l.b, firstKey) l.b.WriteString(prefix) } case MessageKey: if msg := keyvals[i+1]; msg != nil { m := fmt.Sprint(msg) - m = st.Message.Renderer(l.re).Render(m) + m = st.Message.Render(m) writeSpace(&l.b, firstKey) l.b.WriteString(m) } default: sep := separator indentSep := indentSeparator - sep = st.Separator.Renderer(l.re).Render(sep) - indentSep = st.Separator.Renderer(l.re).Render(indentSep) + sep = st.Separator.Render(sep) + indentSep = st.Separator.Render(indentSep) key := fmt.Sprint(keyvals[i]) val := fmt.Sprintf("%+v", keyvals[i+1]) raw := val == "" @@ -234,9 +234,9 @@ func (l *Logger) textFormatter(keyvals ...interface{}) { valueStyle = vs } if keyStyle, ok := st.Keys[key]; ok { - key = keyStyle.Renderer(l.re).Render(key) + key = keyStyle.Render(key) } else { - key = st.Key.Renderer(l.re).Render(key) + key = st.Key.Render(key) } // Values may contain multiple lines, and that format @@ -255,10 +255,10 @@ func (l *Logger) textFormatter(keyvals ...interface{}) { writeSpace(&l.b, firstKey) l.b.WriteString(key) l.b.WriteString(sep) - l.b.WriteString(valueStyle.Renderer(l.re).Render(fmt.Sprintf(`"%s"`, + l.b.WriteString(valueStyle.Render(fmt.Sprintf(`"%s"`, escapeStringForOutput(val, true)))) } else { - val = valueStyle.Renderer(l.re).Render(val) + val = valueStyle.Render(val) writeSpace(&l.b, firstKey) l.b.WriteString(key) l.b.WriteString(sep) diff --git a/text_test.go b/text_test.go index 12220ce..99bb97b 100644 --- a/text_test.go +++ b/text_test.go @@ -13,7 +13,7 @@ import ( "time" "github.com/charmbracelet/lipgloss" - "github.com/muesli/termenv" + "github.com/charmbracelet/shampoo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -245,11 +245,10 @@ func TestTextFatal(t *testing.T) { func TestTextValueStyles(t *testing.T) { var buf bytes.Buffer logger := New(&buf) - logger.SetColorProfile(termenv.ANSI256) - lipgloss.SetColorProfile(termenv.ANSI256) + logger.SetColorProfile(shampoo.ANSI256) st := DefaultStyles() st.Value = lipgloss.NewStyle().Bold(true) - st.Values["key3"] = st.Value.Copy().Underline(true) + st.Values["key3"] = st.Value.Underline(true) logger.SetStyles(st) cases := []struct { name string @@ -410,16 +409,16 @@ func TestTextValueStyles(t *testing.T) { } func TestColorProfile(t *testing.T) { - cases := []termenv.Profile{ - termenv.Ascii, - termenv.ANSI, - termenv.ANSI256, - termenv.TrueColor, + cases := []shampoo.Profile{ + shampoo.Ascii, + shampoo.ANSI, + shampoo.ANSI256, + shampoo.TrueColor, } l := New(io.Discard) for _, p := range cases { l.SetColorProfile(p) - assert.Equal(t, p, l.re.ColorProfile()) + assert.Equal(t, p, l.re.Profile) } } From e17476bb6326993f96a58fd60a289d96d762040a Mon Sep 17 00:00:00 2001 From: bashbunni Date: Thu, 8 Aug 2024 11:50:34 -0700 Subject: [PATCH 03/10] fix: buffer writes n stuff --- logger.go | 35 +++++++++++++++++------------------ pkg.go | 9 ++++----- pkg_test.go | 7 ++++--- text_test.go | 31 +++++++++---------------------- 4 files changed, 34 insertions(+), 48 deletions(-) diff --git a/logger.go b/logger.go index 90cc78d..f04f12d 100644 --- a/logger.go +++ b/logger.go @@ -2,6 +2,7 @@ package log import ( "bytes" + "errors" "fmt" "io" "os" @@ -10,8 +11,6 @@ import ( "sync" "sync/atomic" "time" - - "github.com/charmbracelet/shampoo" ) // ErrMissingValue is returned when a key is missing a value. @@ -25,7 +24,6 @@ type Logger struct { w io.Writer b bytes.Buffer mu *sync.RWMutex - re *shampoo.Writer isDiscard uint32 @@ -133,7 +131,14 @@ func (l *Logger) handle(level Level, ts time.Time, frames []runtime.Frame, msg i } // WriteTo will reset the buffer - l.b.WriteTo(l.w) //nolint: errcheck + if _, err := l.b.WriteTo(l.w); err != nil { + if errors.Is(err, io.ErrShortWrite) { + // Reset the buffer even if the lengths don't match up. If we're + // using shampoo's Writer, it will strip the ansi sequences based on + // the color profile which can cause this error. + l.b.Reset() + } + } } // Helper marks the calling function as a helper @@ -278,13 +283,14 @@ func (l *Logger) SetOutput(w io.Writer) { } atomic.StoreUint32(&l.isDiscard, isDiscard) // Reuse cached renderers - if v, ok := registry.Load(w); ok { - l.re = v.(*shampoo.Writer) - } else { - // TODO calculate background color (termenv.colorcache used to do this) - l.re = shampoo.NewWriter(w, []string{}) - registry.Store(w, l.re) - } + // TODO is this still relevant? + // if v, ok := registry.Load(w); ok { + // l.re = v.(*shampoo.Writer) + // } else { + // // TODO calculate background color (termenv.colorcache used to do this) + // l.re = shampoo.NewWriter(w, os.Environ()) + // registry.Store(w, l.re) + // } } // SetFormatter sets the formatter. @@ -308,13 +314,6 @@ func (l *Logger) SetCallerOffset(offset int) { l.callerOffset = offset } -// SetColorProfile force sets the underlying Lip Gloss renderer color profile -// for the TextFormatter. -func (l *Logger) SetColorProfile(profile shampoo.Profile) { - // TODO should shampoo have a setter for profile? - l.re.Profile = profile -} - // SetStyles sets the logger styles for the TextFormatter. func (l *Logger) SetStyles(s *Styles) { if s == nil { diff --git a/pkg.go b/pkg.go index de7e3e7..00d9d35 100644 --- a/pkg.go +++ b/pkg.go @@ -9,8 +9,6 @@ import ( "sync" "sync/atomic" "time" - - "github.com/charmbracelet/shampoo" ) var ( @@ -138,11 +136,12 @@ func SetPrefix(prefix string) { Default().SetPrefix(prefix) } +// TODO // SetColorProfile force sets the underlying Lip Gloss renderer color profile // for the TextFormatter. -func SetColorProfile(profile shampoo.Profile) { - Default().SetColorProfile(profile) -} +// func SetColorProfile(profile shampoo.Profile) { +// Default().SetColorProfile(profile) +// } // SetStyles sets the logger styles for the TextFormatter. func SetStyles(s *Styles) { diff --git a/pkg_test.go b/pkg_test.go index afc2fbc..e7c83a9 100644 --- a/pkg_test.go +++ b/pkg_test.go @@ -76,13 +76,14 @@ func TestGlobal(t *testing.T) { func TestPrint(t *testing.T) { var buf bytes.Buffer - SetOutput(&buf) + w := shampoo.NewWriter(&buf, os.Environ()) + w.Profile = shampoo.ANSI + SetOutput(w) SetLevel(FatalLevel) SetTimeFunction(_zeroTime) SetReportTimestamp(true) SetReportCaller(false) SetTimeFormat(DefaultTimeFormat) - SetColorProfile(shampoo.ANSI) Error("error") Print("print") assert.Equal(t, "0002/01/01 00:00:00 print\n", buf.String()) @@ -90,7 +91,7 @@ func TestPrint(t *testing.T) { func TestPrintf(t *testing.T) { var buf bytes.Buffer - SetOutput(&buf) + SetOutput(shampoo.NewWriter(&buf, os.Environ())) SetLevel(FatalLevel) SetTimeFunction(_zeroTime) SetReportTimestamp(true) diff --git a/text_test.go b/text_test.go index 99bb97b..32a9658 100644 --- a/text_test.go +++ b/text_test.go @@ -24,14 +24,14 @@ func _zeroTime(time.Time) time.Time { func TestNilStyles(t *testing.T) { st := DefaultStyles() - l := New(io.Discard) + l := New(shampoo.NewWriter(io.Discard, os.Environ())) l.SetStyles(nil) assert.Equal(t, st, l.styles) } func TestTextCaller(t *testing.T) { var buf bytes.Buffer - logger := New(&buf) + logger := New(shampoo.NewWriter(&buf, os.Environ())) logger.SetReportCaller(true) // We calculate the caller offset based on the caller line number. _, file, line, _ := runtime.Caller(0) @@ -100,7 +100,7 @@ func TestTextCaller(t *testing.T) { func TestTextLogger(t *testing.T) { var buf bytes.Buffer - logger := New(&buf) + logger := New(shampoo.NewWriter(&buf, os.Environ())) cases := []struct { name string expected string @@ -211,7 +211,7 @@ func TestTextLogger(t *testing.T) { func TestTextHelper(t *testing.T) { var buf bytes.Buffer - logger := New(&buf) + logger := New(shampoo.NewWriter(&buf, os.Environ())) logger.SetReportCaller(true) helper := func() { logger.Helper() @@ -226,7 +226,7 @@ func TestTextHelper(t *testing.T) { func TestTextFatal(t *testing.T) { var buf bytes.Buffer - logger := New(&buf) + logger := New(shampoo.NewWriter(&buf, os.Environ())) logger.SetReportCaller(true) if os.Getenv("FATAL") == "1" { logger.Fatal("i'm dead") @@ -244,8 +244,9 @@ func TestTextFatal(t *testing.T) { func TestTextValueStyles(t *testing.T) { var buf bytes.Buffer - logger := New(&buf) - logger.SetColorProfile(shampoo.ANSI256) + w := shampoo.NewWriter(&buf, os.Environ()) + w.Profile = shampoo.ANSI256 + logger := New(w) st := DefaultStyles() st.Value = lipgloss.NewStyle().Bold(true) st.Values["key3"] = st.Value.Underline(true) @@ -408,23 +409,9 @@ func TestTextValueStyles(t *testing.T) { } } -func TestColorProfile(t *testing.T) { - cases := []shampoo.Profile{ - shampoo.Ascii, - shampoo.ANSI, - shampoo.ANSI256, - shampoo.TrueColor, - } - l := New(io.Discard) - for _, p := range cases { - l.SetColorProfile(p) - assert.Equal(t, p, l.re.Profile) - } -} - func TestCustomLevelStyle(t *testing.T) { var buf bytes.Buffer - l := New(&buf) + l := New(shampoo.NewWriter(&buf, os.Environ())) st := DefaultStyles() lvl := Level(1234) st.Levels[lvl] = lipgloss.NewStyle().Bold(true).SetString("FUNKY") From 7671c0fc615aac557dc8b4ce9405ebfbbe52d7b0 Mon Sep 17 00:00:00 2001 From: bashbunni Date: Thu, 8 Aug 2024 11:55:07 -0700 Subject: [PATCH 04/10] fix(test): use shampoo in stdlog_test --- stdlog_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/stdlog_test.go b/stdlog_test.go index 6cf73a7..4cad829 100644 --- a/stdlog_test.go +++ b/stdlog_test.go @@ -4,17 +4,19 @@ import ( "bytes" "fmt" "log" + "os" "path/filepath" "runtime" "testing" + "github.com/charmbracelet/shampoo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestStdLog(t *testing.T) { var buf bytes.Buffer - l := New(&buf) + l := New(shampoo.NewWriter(&buf, os.Environ())) cases := []struct { f func(l *log.Logger) name string @@ -49,7 +51,7 @@ func TestStdLog(t *testing.T) { func TestStdLog_forceLevel(t *testing.T) { var buf bytes.Buffer - logger := New(&buf) + logger := New(shampoo.NewWriter(&buf, os.Environ())) cases := []struct { name string expected string @@ -83,7 +85,7 @@ func TestStdLog_forceLevel(t *testing.T) { func TestStdLog_writer(t *testing.T) { var buf bytes.Buffer - logger := New(&buf) + logger := New(shampoo.NewWriter(&buf, os.Environ())) logger.SetReportCaller(true) _, file, line, ok := runtime.Caller(0) require.True(t, ok) From 95e061c84b10d8e6193bc9a95183a7720f6b61b9 Mon Sep 17 00:00:00 2001 From: bashbunni Date: Thu, 8 Aug 2024 16:13:04 -0700 Subject: [PATCH 05/10] fix(test): pass all tests using shampoo.Writer --- context_test.go | 6 ++++-- json_test.go | 12 +++++++----- logfmt_test.go | 4 +++- logger_121_test.go | 8 +++++--- logger_test.go | 12 +++++++----- options_test.go | 6 ++++-- pkg_test.go | 18 +++++++++--------- stdlog_test.go | 2 +- 8 files changed, 40 insertions(+), 28 deletions(-) diff --git a/context_test.go b/context_test.go index afb95ac..f0aaba0 100644 --- a/context_test.go +++ b/context_test.go @@ -4,8 +4,10 @@ import ( "bytes" "context" "io" + "os" "testing" + "github.com/charmbracelet/shampoo" "github.com/stretchr/testify/require" ) @@ -14,14 +16,14 @@ func TestLogContext_empty(t *testing.T) { } func TestLogContext_simple(t *testing.T) { - l := New(io.Discard) + l := New(shampoo.NewWriter(io.Discard, os.Environ())) ctx := WithContext(context.Background(), l) require.Equal(t, l, FromContext(ctx)) } func TestLogContext_fields(t *testing.T) { var buf bytes.Buffer - l := New(&buf) + l := New(shampoo.NewWriter(&buf, os.Environ())) l.SetLevel(DebugLevel) ctx := WithContext(context.Background(), l.With("foo", "bar")) l = FromContext(ctx) diff --git a/json_test.go b/json_test.go index 99fc3fa..30a98c2 100644 --- a/json_test.go +++ b/json_test.go @@ -4,16 +4,18 @@ import ( "bytes" "errors" "fmt" + "os" "path/filepath" "runtime" "testing" + "github.com/charmbracelet/shampoo" "github.com/stretchr/testify/require" ) func TestJson(t *testing.T) { var buf bytes.Buffer - l := New(&buf) + l := New(shampoo.NewWriter(&buf, os.Environ())) l.SetFormatter(JSONFormatter) cases := []struct { name string @@ -125,7 +127,7 @@ func TestJson(t *testing.T) { func TestJsonCaller(t *testing.T) { var buf bytes.Buffer - l := New(&buf) + l := New(shampoo.NewWriter(&buf, os.Environ())) l.SetFormatter(JSONFormatter) l.SetReportCaller(true) l.SetLevel(DebugLevel) @@ -167,7 +169,7 @@ func TestJsonCaller(t *testing.T) { func TestJsonTime(t *testing.T) { var buf bytes.Buffer - logger := New(&buf) + logger := New(shampoo.NewWriter(&buf, os.Environ())) logger.SetTimeFunction(_zeroTime) logger.SetFormatter(JSONFormatter) logger.SetReportTimestamp(true) @@ -177,7 +179,7 @@ func TestJsonTime(t *testing.T) { func TestJsonPrefix(t *testing.T) { var buf bytes.Buffer - logger := New(&buf) + logger := New(shampoo.NewWriter(&buf, os.Environ())) logger.SetFormatter(JSONFormatter) logger.SetPrefix("my-prefix") logger.Info("info") @@ -191,7 +193,7 @@ func TestJsonCustomKey(t *testing.T) { TimestampKey = oldTsKey }() TimestampKey = "other-time" - logger := New(&buf) + logger := New(shampoo.NewWriter(&buf, os.Environ())) logger.SetTimeFunction(_zeroTime) logger.SetFormatter(JSONFormatter) logger.SetReportTimestamp(true) diff --git a/logfmt_test.go b/logfmt_test.go index e748d76..223b399 100644 --- a/logfmt_test.go +++ b/logfmt_test.go @@ -3,14 +3,16 @@ package log import ( "bytes" "errors" + "os" "testing" + "github.com/charmbracelet/shampoo" "github.com/stretchr/testify/assert" ) func TestLogfmt(t *testing.T) { var buf bytes.Buffer - l := New(&buf) + l := New(shampoo.NewWriter(&buf, os.Environ())) l.SetFormatter(LogfmtFormatter) cases := []struct { name string diff --git a/logger_121_test.go b/logger_121_test.go index 1090816..7485ec7 100644 --- a/logger_121_test.go +++ b/logger_121_test.go @@ -7,15 +7,17 @@ import ( "bytes" "context" "log/slog" + "os" "testing" "time" + "github.com/charmbracelet/shampoo" "github.com/stretchr/testify/assert" ) func TestSlogSimple(t *testing.T) { var buf bytes.Buffer - h := New(&buf) + h := New(shampoo.NewWriter(&buf, os.Environ())) h.SetLevel(DebugLevel) l := slog.New(h) cases := []struct { @@ -73,7 +75,7 @@ func TestSlogSimple(t *testing.T) { func TestSlogWith(t *testing.T) { var buf bytes.Buffer - h := New(&buf) + h := New(shampoo.NewWriter(&buf, os.Environ())) h.SetLevel(DebugLevel) l := slog.New(h).With("a", "b") cases := []struct { @@ -124,7 +126,7 @@ func TestSlogWith(t *testing.T) { func TestSlogWithGroup(t *testing.T) { var buf bytes.Buffer - h := New(&buf) + h := New(shampoo.NewWriter(&buf, os.Environ())) l := slog.New(h).WithGroup("charm").WithGroup("bracelet") cases := []struct { name string diff --git a/logger_test.go b/logger_test.go index d46facc..9e80aed 100644 --- a/logger_test.go +++ b/logger_test.go @@ -4,16 +4,18 @@ import ( "bytes" "fmt" "io" + "os" "sync" "testing" "time" + "github.com/charmbracelet/shampoo" "github.com/stretchr/testify/assert" ) func TestSubLogger(t *testing.T) { var buf bytes.Buffer - l := New(&buf) + l := New(shampoo.NewWriter(&buf, os.Environ())) cases := []struct { name string expected string @@ -80,7 +82,7 @@ func TestWrongLevel(t *testing.T) { for _, c := range cases { t.Run(c.name, func(t *testing.T) { buf.Reset() - l := New(&buf) + l := New(shampoo.NewWriter(&buf, os.Environ())) l.SetLevel(c.level) l.Info("info") assert.Equal(t, c.expected, buf.String()) @@ -90,7 +92,7 @@ func TestWrongLevel(t *testing.T) { func TestLogFormatter(t *testing.T) { var buf bytes.Buffer - l := New(&buf) + l := New(shampoo.NewWriter(&buf, os.Environ())) l.SetLevel(DebugLevel) cases := []struct { name string @@ -139,7 +141,7 @@ func TestLogFormatter(t *testing.T) { func TestEmptyMessage(t *testing.T) { var buf bytes.Buffer - l := New(&buf) + l := New(shampoo.NewWriter(&buf, os.Environ())) cases := []struct { name string expected string @@ -196,7 +198,7 @@ func TestLogWithPrefix(t *testing.T) { for _, c := range cases { t.Run(c.name, func(t *testing.T) { buf.Reset() - l := New(&buf) + l := New(shampoo.NewWriter(&buf, os.Environ())) l.SetPrefix(c.prefix) l.Info(c.msg) assert.Equal(t, c.expected, buf.String()) diff --git a/options_test.go b/options_test.go index 9262a01..61e34d5 100644 --- a/options_test.go +++ b/options_test.go @@ -4,8 +4,10 @@ import ( "bytes" "fmt" "io" + "os" "testing" + "github.com/charmbracelet/shampoo" "github.com/stretchr/testify/require" ) @@ -15,7 +17,7 @@ func TestOptions(t *testing.T) { ReportCaller: true, Fields: []interface{}{"foo", "bar"}, } - logger := NewWithOptions(io.Discard, opts) + logger := NewWithOptions(shampoo.NewWriter(io.Discard, os.Environ()), opts) require.Equal(t, ErrorLevel, logger.GetLevel()) require.True(t, logger.reportCaller) require.False(t, logger.reportTimestamp) @@ -27,7 +29,7 @@ func TestOptions(t *testing.T) { func TestCallerFormatter(t *testing.T) { var buf bytes.Buffer - l := NewWithOptions(&buf, Options{ReportCaller: true}) + l := NewWithOptions(shampoo.NewWriter(&buf, os.Environ()), Options{ReportCaller: true}) frames := l.frames(0) frame, _ := frames.Next() file, line, fn := frame.File, frame.Line, frame.Function diff --git a/pkg_test.go b/pkg_test.go index e7c83a9..e0faaa9 100644 --- a/pkg_test.go +++ b/pkg_test.go @@ -34,7 +34,7 @@ func TestDefaultRace(t *testing.T) { func TestGlobal(t *testing.T) { var buf bytes.Buffer - SetOutput(&buf) + SetOutput(shampoo.NewWriter(&buf, os.Environ())) SetTimeFunction(_zeroTime) cases := []struct { name string @@ -138,7 +138,7 @@ func TestFatalf(t *testing.T) { func TestDebugf(t *testing.T) { var buf bytes.Buffer - SetOutput(&buf) + SetOutput(shampoo.NewWriter(&buf, os.Environ())) SetLevel(DebugLevel) SetTimeFunction(_zeroTime) SetReportTimestamp(true) @@ -151,7 +151,7 @@ func TestDebugf(t *testing.T) { func TestInfof(t *testing.T) { var buf bytes.Buffer - SetOutput(&buf) + SetOutput(shampoo.NewWriter(&buf, os.Environ())) SetLevel(InfoLevel) SetReportTimestamp(false) SetReportCaller(false) @@ -162,7 +162,7 @@ func TestInfof(t *testing.T) { func TestWarnf(t *testing.T) { var buf bytes.Buffer - SetOutput(&buf) + SetOutput(shampoo.NewWriter(&buf, os.Environ())) SetLevel(WarnLevel) SetReportCaller(false) SetReportTimestamp(true) @@ -174,7 +174,7 @@ func TestWarnf(t *testing.T) { func TestErrorf(t *testing.T) { var buf bytes.Buffer - SetOutput(&buf) + SetOutput(shampoo.NewWriter(&buf, os.Environ())) SetLevel(ErrorLevel) SetReportCaller(false) SetReportTimestamp(true) @@ -186,7 +186,7 @@ func TestErrorf(t *testing.T) { func TestWith(t *testing.T) { var buf bytes.Buffer - SetOutput(&buf) + SetOutput(shampoo.NewWriter(&buf, os.Environ())) SetLevel(InfoLevel) SetReportCaller(false) SetReportTimestamp(true) @@ -203,7 +203,7 @@ func TestGetLevel(t *testing.T) { func TestPrefix(t *testing.T) { var buf bytes.Buffer - SetOutput(&buf) + SetOutput(shampoo.NewWriter(&buf, os.Environ())) SetLevel(WarnLevel) SetReportCaller(false) SetReportTimestamp(false) @@ -216,7 +216,7 @@ func TestPrefix(t *testing.T) { func TestFormatter(t *testing.T) { var buf bytes.Buffer - SetOutput(&buf) + SetOutput(shampoo.NewWriter(&buf, os.Environ())) SetLevel(InfoLevel) SetReportCaller(false) SetReportTimestamp(false) @@ -233,7 +233,7 @@ func TestWithPrefix(t *testing.T) { func TestGlobalCustomLevel(t *testing.T) { var buf bytes.Buffer lvl := Level(-1) - SetOutput(&buf) + SetOutput(shampoo.NewWriter(&buf, os.Environ())) SetLevel(lvl) SetReportCaller(false) SetReportTimestamp(false) diff --git a/stdlog_test.go b/stdlog_test.go index 4cad829..24c2e5c 100644 --- a/stdlog_test.go +++ b/stdlog_test.go @@ -41,7 +41,7 @@ func TestStdLog(t *testing.T) { for _, c := range cases { buf.Reset() t.Run(c.name, func(t *testing.T) { - l.SetOutput(&buf) + l.SetOutput(shampoo.NewWriter(&buf, os.Environ())) l.SetTimeFunction(_zeroTime) c.f(l.StandardLog()) assert.Equal(t, c.expected, buf.String()) From 47ce960d48477e74769e446a6049f5502596e93a Mon Sep 17 00:00:00 2001 From: bashbunni Date: Thu, 10 Oct 2024 15:29:13 -0700 Subject: [PATCH 06/10] chore(deps): replace shampoo with colorprofile --- context_test.go | 6 +++--- go.mod | 18 +++++------------- go.sum | 39 ++++++++++----------------------------- json_test.go | 12 ++++++------ logfmt_test.go | 4 ++-- logger.go | 6 +++--- logger_121_test.go | 8 ++++---- logger_test.go | 12 ++++++------ options_test.go | 6 +++--- pkg.go | 2 +- pkg_test.go | 26 +++++++++++++------------- stdlog_test.go | 10 +++++----- text_test.go | 18 +++++++++--------- 13 files changed, 70 insertions(+), 97 deletions(-) diff --git a/context_test.go b/context_test.go index f0aaba0..9f6d958 100644 --- a/context_test.go +++ b/context_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/charmbracelet/shampoo" + "github.com/charmbracelet/colorprofile" "github.com/stretchr/testify/require" ) @@ -16,14 +16,14 @@ func TestLogContext_empty(t *testing.T) { } func TestLogContext_simple(t *testing.T) { - l := New(shampoo.NewWriter(io.Discard, os.Environ())) + l := New(colorprofile.NewWriter(io.Discard, os.Environ())) ctx := WithContext(context.Background(), l) require.Equal(t, l, FromContext(ctx)) } func TestLogContext_fields(t *testing.T) { var buf bytes.Buffer - l := New(shampoo.NewWriter(&buf, os.Environ())) + l := New(colorprofile.NewWriter(&buf, os.Environ())) l.SetLevel(DebugLevel) ctx := WithContext(context.Background(), l.With("foo", "bar")) l = FromContext(ctx) diff --git a/go.mod b/go.mod index 72cb25b..30f1ec3 100644 --- a/go.mod +++ b/go.mod @@ -3,29 +3,21 @@ module github.com/charmbracelet/log go 1.19 require ( - github.com/charmbracelet/lipgloss v0.12.2-0.20240722162534-2390dea254e8 - github.com/charmbracelet/shampoo v0.0.0-20240807160433-2fdf07ab2f73 + github.com/charmbracelet/colorprofile v0.1.1 + github.com/charmbracelet/lipgloss v0.13.1-0.20240822211938-b89f1a3db2a4 github.com/go-logfmt/logfmt v0.6.0 github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20231006140011-7918f672742d ) require ( - github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect - github.com/charmbracelet/x/ansi v0.1.5-0.20240807160011-7b9bd9980386 // indirect - github.com/charmbracelet/x/input v0.1.3 // indirect - github.com/charmbracelet/x/term v0.1.1 // indirect - github.com/charmbracelet/x/windows v0.1.2 // indirect + github.com/charmbracelet/x/ansi v0.3.2 // indirect + github.com/charmbracelet/x/term v0.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.16 // indirect - github.com/muesli/cancelreader v0.2.2 // indirect - github.com/muesli/termenv v0.15.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect - golang.org/x/sys v0.23.0 // indirect + golang.org/x/sys v0.26.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 1caeb67..bac0850 100644 --- a/go.sum +++ b/go.sum @@ -1,36 +1,19 @@ -github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= -github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= -github.com/charmbracelet/lipgloss v0.12.2-0.20240722162534-2390dea254e8 h1:7SMpm8y17K515kM1Q/tiOrSm1jb3hJh94W+LXHWKv+U= -github.com/charmbracelet/lipgloss v0.12.2-0.20240722162534-2390dea254e8/go.mod h1:LCQCsVTQm+lcQLFSiHwSvQUqRXtry1v/2KCfKxdsCeY= -github.com/charmbracelet/shampoo v0.0.0-20240807160433-2fdf07ab2f73 h1:0jbSZZFsjfd8+wAbSX5IX5iTbam8moe81Jt9vpCnxL4= -github.com/charmbracelet/shampoo v0.0.0-20240807160433-2fdf07ab2f73/go.mod h1:McJMdgyoMSHqV0p+ejH4i0jaaK5SAYUp8EgRqUjLBxI= -github.com/charmbracelet/x/ansi v0.1.5-0.20240807160011-7b9bd9980386 h1:aOjzT+GwoykWSR1HiE4nFz+2HD+M7jKa5B3jl6BZhUo= -github.com/charmbracelet/x/ansi v0.1.5-0.20240807160011-7b9bd9980386/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= -github.com/charmbracelet/x/input v0.1.3 h1:oy4TMhyGQsYs/WWJwu1ELUMFnjiUAXwtDf048fHbCkg= -github.com/charmbracelet/x/input v0.1.3/go.mod h1:1gaCOyw1KI9e2j00j/BBZ4ErzRZqa05w0Ghn83yIhKU= -github.com/charmbracelet/x/term v0.1.1 h1:3cosVAiPOig+EV4X9U+3LDgtwwAoEzJjNdwbXDjF6yI= -github.com/charmbracelet/x/term v0.1.1/go.mod h1:wB1fHt5ECsu3mXYusyzcngVWWlu1KKUmmLhfgr/Flxw= -github.com/charmbracelet/x/windows v0.1.2 h1:Iumiwq2G+BRmgoayww/qfcvof7W/3uLoelhxojXlRWg= -github.com/charmbracelet/x/windows v0.1.2/go.mod h1:GLEO/l+lizvFDBPLIOk+49gdX49L9YWMB5t+DZd0jkQ= +github.com/charmbracelet/colorprofile v0.1.1 h1:YsvIsmZ2bazhejG+5g5MPPMpllc7Ks66Nk8l3IvGJ2g= +github.com/charmbracelet/colorprofile v0.1.1/go.mod h1:1htIKZYeI4TQs+OykPvpuBTUbUJxBYeSYBDIZuejMj0= +github.com/charmbracelet/lipgloss v0.13.1-0.20240822211938-b89f1a3db2a4 h1:BuZojjzjQ89wObGNVxJzFqyeh2S6Crbwhybb8bZNveI= +github.com/charmbracelet/lipgloss v0.13.1-0.20240822211938-b89f1a3db2a4/go.mod h1:ZbN5GVH/VrXHPRa1lZqZ1HWJyayJHJYaf9ywsCuI9zQ= +github.com/charmbracelet/x/ansi v0.3.2 h1:wsEwgAN+C9U06l9dCVMX0/L3x7ptvY1qmjMwyfE6USY= +github.com/charmbracelet/x/ansi v0.3.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0= +github.com/charmbracelet/x/term v0.2.0/go.mod h1:GVxgxAbjUrmpvIINHIQnJJKpMlHiZ4cktEQCN6GWyF0= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= -github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= -github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= -github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= -github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= -github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= @@ -39,10 +22,8 @@ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavM github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= 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/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/json_test.go b/json_test.go index 30a98c2..3929fe3 100644 --- a/json_test.go +++ b/json_test.go @@ -9,13 +9,13 @@ import ( "runtime" "testing" - "github.com/charmbracelet/shampoo" + "github.com/charmbracelet/colorprofile" "github.com/stretchr/testify/require" ) func TestJson(t *testing.T) { var buf bytes.Buffer - l := New(shampoo.NewWriter(&buf, os.Environ())) + l := New(colorprofile.NewWriter(&buf, os.Environ())) l.SetFormatter(JSONFormatter) cases := []struct { name string @@ -127,7 +127,7 @@ func TestJson(t *testing.T) { func TestJsonCaller(t *testing.T) { var buf bytes.Buffer - l := New(shampoo.NewWriter(&buf, os.Environ())) + l := New(colorprofile.NewWriter(&buf, os.Environ())) l.SetFormatter(JSONFormatter) l.SetReportCaller(true) l.SetLevel(DebugLevel) @@ -169,7 +169,7 @@ func TestJsonCaller(t *testing.T) { func TestJsonTime(t *testing.T) { var buf bytes.Buffer - logger := New(shampoo.NewWriter(&buf, os.Environ())) + logger := New(colorprofile.NewWriter(&buf, os.Environ())) logger.SetTimeFunction(_zeroTime) logger.SetFormatter(JSONFormatter) logger.SetReportTimestamp(true) @@ -179,7 +179,7 @@ func TestJsonTime(t *testing.T) { func TestJsonPrefix(t *testing.T) { var buf bytes.Buffer - logger := New(shampoo.NewWriter(&buf, os.Environ())) + logger := New(colorprofile.NewWriter(&buf, os.Environ())) logger.SetFormatter(JSONFormatter) logger.SetPrefix("my-prefix") logger.Info("info") @@ -193,7 +193,7 @@ func TestJsonCustomKey(t *testing.T) { TimestampKey = oldTsKey }() TimestampKey = "other-time" - logger := New(shampoo.NewWriter(&buf, os.Environ())) + logger := New(colorprofile.NewWriter(&buf, os.Environ())) logger.SetTimeFunction(_zeroTime) logger.SetFormatter(JSONFormatter) logger.SetReportTimestamp(true) diff --git a/logfmt_test.go b/logfmt_test.go index 223b399..85e20d5 100644 --- a/logfmt_test.go +++ b/logfmt_test.go @@ -6,13 +6,13 @@ import ( "os" "testing" - "github.com/charmbracelet/shampoo" + "github.com/charmbracelet/colorprofile" "github.com/stretchr/testify/assert" ) func TestLogfmt(t *testing.T) { var buf bytes.Buffer - l := New(shampoo.NewWriter(&buf, os.Environ())) + l := New(colorprofile.NewWriter(&buf, os.Environ())) l.SetFormatter(LogfmtFormatter) cases := []struct { name string diff --git a/logger.go b/logger.go index f04f12d..fe62221 100644 --- a/logger.go +++ b/logger.go @@ -134,7 +134,7 @@ func (l *Logger) handle(level Level, ts time.Time, frames []runtime.Frame, msg i if _, err := l.b.WriteTo(l.w); err != nil { if errors.Is(err, io.ErrShortWrite) { // Reset the buffer even if the lengths don't match up. If we're - // using shampoo's Writer, it will strip the ansi sequences based on + // using colorprofile's Writer, it will strip the ansi sequences based on // the color profile which can cause this error. l.b.Reset() } @@ -285,10 +285,10 @@ func (l *Logger) SetOutput(w io.Writer) { // Reuse cached renderers // TODO is this still relevant? // if v, ok := registry.Load(w); ok { - // l.re = v.(*shampoo.Writer) + // l.re = v.(*colorprofile.Writer) // } else { // // TODO calculate background color (termenv.colorcache used to do this) - // l.re = shampoo.NewWriter(w, os.Environ()) + // l.re = colorprofile.NewWriter(w, os.Environ()) // registry.Store(w, l.re) // } } diff --git a/logger_121_test.go b/logger_121_test.go index 7485ec7..04d3f46 100644 --- a/logger_121_test.go +++ b/logger_121_test.go @@ -11,13 +11,13 @@ import ( "testing" "time" - "github.com/charmbracelet/shampoo" + "github.com/charmbracelet/colorprofile" "github.com/stretchr/testify/assert" ) func TestSlogSimple(t *testing.T) { var buf bytes.Buffer - h := New(shampoo.NewWriter(&buf, os.Environ())) + h := New(colorprofile.NewWriter(&buf, os.Environ())) h.SetLevel(DebugLevel) l := slog.New(h) cases := []struct { @@ -75,7 +75,7 @@ func TestSlogSimple(t *testing.T) { func TestSlogWith(t *testing.T) { var buf bytes.Buffer - h := New(shampoo.NewWriter(&buf, os.Environ())) + h := New(colorprofile.NewWriter(&buf, os.Environ())) h.SetLevel(DebugLevel) l := slog.New(h).With("a", "b") cases := []struct { @@ -126,7 +126,7 @@ func TestSlogWith(t *testing.T) { func TestSlogWithGroup(t *testing.T) { var buf bytes.Buffer - h := New(shampoo.NewWriter(&buf, os.Environ())) + h := New(colorprofile.NewWriter(&buf, os.Environ())) l := slog.New(h).WithGroup("charm").WithGroup("bracelet") cases := []struct { name string diff --git a/logger_test.go b/logger_test.go index 9e80aed..ba5b167 100644 --- a/logger_test.go +++ b/logger_test.go @@ -9,13 +9,13 @@ import ( "testing" "time" - "github.com/charmbracelet/shampoo" + "github.com/charmbracelet/colorprofile" "github.com/stretchr/testify/assert" ) func TestSubLogger(t *testing.T) { var buf bytes.Buffer - l := New(shampoo.NewWriter(&buf, os.Environ())) + l := New(colorprofile.NewWriter(&buf, os.Environ())) cases := []struct { name string expected string @@ -82,7 +82,7 @@ func TestWrongLevel(t *testing.T) { for _, c := range cases { t.Run(c.name, func(t *testing.T) { buf.Reset() - l := New(shampoo.NewWriter(&buf, os.Environ())) + l := New(colorprofile.NewWriter(&buf, os.Environ())) l.SetLevel(c.level) l.Info("info") assert.Equal(t, c.expected, buf.String()) @@ -92,7 +92,7 @@ func TestWrongLevel(t *testing.T) { func TestLogFormatter(t *testing.T) { var buf bytes.Buffer - l := New(shampoo.NewWriter(&buf, os.Environ())) + l := New(colorprofile.NewWriter(&buf, os.Environ())) l.SetLevel(DebugLevel) cases := []struct { name string @@ -141,7 +141,7 @@ func TestLogFormatter(t *testing.T) { func TestEmptyMessage(t *testing.T) { var buf bytes.Buffer - l := New(shampoo.NewWriter(&buf, os.Environ())) + l := New(colorprofile.NewWriter(&buf, os.Environ())) cases := []struct { name string expected string @@ -198,7 +198,7 @@ func TestLogWithPrefix(t *testing.T) { for _, c := range cases { t.Run(c.name, func(t *testing.T) { buf.Reset() - l := New(shampoo.NewWriter(&buf, os.Environ())) + l := New(colorprofile.NewWriter(&buf, os.Environ())) l.SetPrefix(c.prefix) l.Info(c.msg) assert.Equal(t, c.expected, buf.String()) diff --git a/options_test.go b/options_test.go index 61e34d5..3ef2060 100644 --- a/options_test.go +++ b/options_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/charmbracelet/shampoo" + "github.com/charmbracelet/colorprofile" "github.com/stretchr/testify/require" ) @@ -17,7 +17,7 @@ func TestOptions(t *testing.T) { ReportCaller: true, Fields: []interface{}{"foo", "bar"}, } - logger := NewWithOptions(shampoo.NewWriter(io.Discard, os.Environ()), opts) + logger := NewWithOptions(colorprofile.NewWriter(io.Discard, os.Environ()), opts) require.Equal(t, ErrorLevel, logger.GetLevel()) require.True(t, logger.reportCaller) require.False(t, logger.reportTimestamp) @@ -29,7 +29,7 @@ func TestOptions(t *testing.T) { func TestCallerFormatter(t *testing.T) { var buf bytes.Buffer - l := NewWithOptions(shampoo.NewWriter(&buf, os.Environ()), Options{ReportCaller: true}) + l := NewWithOptions(colorprofile.NewWriter(&buf, os.Environ()), Options{ReportCaller: true}) frames := l.frames(0) frame, _ := frames.Next() file, line, fn := frame.File, frame.Line, frame.Function diff --git a/pkg.go b/pkg.go index 00d9d35..2adde31 100644 --- a/pkg.go +++ b/pkg.go @@ -139,7 +139,7 @@ func SetPrefix(prefix string) { // TODO // SetColorProfile force sets the underlying Lip Gloss renderer color profile // for the TextFormatter. -// func SetColorProfile(profile shampoo.Profile) { +// func SetColorProfile(profile colorprofile.Profile) { // Default().SetColorProfile(profile) // } diff --git a/pkg_test.go b/pkg_test.go index e0faaa9..d5fb99b 100644 --- a/pkg_test.go +++ b/pkg_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "github.com/charmbracelet/shampoo" + "github.com/charmbracelet/colorprofile" "github.com/stretchr/testify/assert" ) @@ -34,7 +34,7 @@ func TestDefaultRace(t *testing.T) { func TestGlobal(t *testing.T) { var buf bytes.Buffer - SetOutput(shampoo.NewWriter(&buf, os.Environ())) + SetOutput(colorprofile.NewWriter(&buf, os.Environ())) SetTimeFunction(_zeroTime) cases := []struct { name string @@ -76,8 +76,8 @@ func TestGlobal(t *testing.T) { func TestPrint(t *testing.T) { var buf bytes.Buffer - w := shampoo.NewWriter(&buf, os.Environ()) - w.Profile = shampoo.ANSI + w := colorprofile.NewWriter(&buf, os.Environ()) + w.Profile = colorprofile.ANSI SetOutput(w) SetLevel(FatalLevel) SetTimeFunction(_zeroTime) @@ -91,7 +91,7 @@ func TestPrint(t *testing.T) { func TestPrintf(t *testing.T) { var buf bytes.Buffer - SetOutput(shampoo.NewWriter(&buf, os.Environ())) + SetOutput(colorprofile.NewWriter(&buf, os.Environ())) SetLevel(FatalLevel) SetTimeFunction(_zeroTime) SetReportTimestamp(true) @@ -138,7 +138,7 @@ func TestFatalf(t *testing.T) { func TestDebugf(t *testing.T) { var buf bytes.Buffer - SetOutput(shampoo.NewWriter(&buf, os.Environ())) + SetOutput(colorprofile.NewWriter(&buf, os.Environ())) SetLevel(DebugLevel) SetTimeFunction(_zeroTime) SetReportTimestamp(true) @@ -151,7 +151,7 @@ func TestDebugf(t *testing.T) { func TestInfof(t *testing.T) { var buf bytes.Buffer - SetOutput(shampoo.NewWriter(&buf, os.Environ())) + SetOutput(colorprofile.NewWriter(&buf, os.Environ())) SetLevel(InfoLevel) SetReportTimestamp(false) SetReportCaller(false) @@ -162,7 +162,7 @@ func TestInfof(t *testing.T) { func TestWarnf(t *testing.T) { var buf bytes.Buffer - SetOutput(shampoo.NewWriter(&buf, os.Environ())) + SetOutput(colorprofile.NewWriter(&buf, os.Environ())) SetLevel(WarnLevel) SetReportCaller(false) SetReportTimestamp(true) @@ -174,7 +174,7 @@ func TestWarnf(t *testing.T) { func TestErrorf(t *testing.T) { var buf bytes.Buffer - SetOutput(shampoo.NewWriter(&buf, os.Environ())) + SetOutput(colorprofile.NewWriter(&buf, os.Environ())) SetLevel(ErrorLevel) SetReportCaller(false) SetReportTimestamp(true) @@ -186,7 +186,7 @@ func TestErrorf(t *testing.T) { func TestWith(t *testing.T) { var buf bytes.Buffer - SetOutput(shampoo.NewWriter(&buf, os.Environ())) + SetOutput(colorprofile.NewWriter(&buf, os.Environ())) SetLevel(InfoLevel) SetReportCaller(false) SetReportTimestamp(true) @@ -203,7 +203,7 @@ func TestGetLevel(t *testing.T) { func TestPrefix(t *testing.T) { var buf bytes.Buffer - SetOutput(shampoo.NewWriter(&buf, os.Environ())) + SetOutput(colorprofile.NewWriter(&buf, os.Environ())) SetLevel(WarnLevel) SetReportCaller(false) SetReportTimestamp(false) @@ -216,7 +216,7 @@ func TestPrefix(t *testing.T) { func TestFormatter(t *testing.T) { var buf bytes.Buffer - SetOutput(shampoo.NewWriter(&buf, os.Environ())) + SetOutput(colorprofile.NewWriter(&buf, os.Environ())) SetLevel(InfoLevel) SetReportCaller(false) SetReportTimestamp(false) @@ -233,7 +233,7 @@ func TestWithPrefix(t *testing.T) { func TestGlobalCustomLevel(t *testing.T) { var buf bytes.Buffer lvl := Level(-1) - SetOutput(shampoo.NewWriter(&buf, os.Environ())) + SetOutput(colorprofile.NewWriter(&buf, os.Environ())) SetLevel(lvl) SetReportCaller(false) SetReportTimestamp(false) diff --git a/stdlog_test.go b/stdlog_test.go index 24c2e5c..316c0c8 100644 --- a/stdlog_test.go +++ b/stdlog_test.go @@ -9,14 +9,14 @@ import ( "runtime" "testing" - "github.com/charmbracelet/shampoo" + "github.com/charmbracelet/colorprofile" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestStdLog(t *testing.T) { var buf bytes.Buffer - l := New(shampoo.NewWriter(&buf, os.Environ())) + l := New(colorprofile.NewWriter(&buf, os.Environ())) cases := []struct { f func(l *log.Logger) name string @@ -41,7 +41,7 @@ func TestStdLog(t *testing.T) { for _, c := range cases { buf.Reset() t.Run(c.name, func(t *testing.T) { - l.SetOutput(shampoo.NewWriter(&buf, os.Environ())) + l.SetOutput(colorprofile.NewWriter(&buf, os.Environ())) l.SetTimeFunction(_zeroTime) c.f(l.StandardLog()) assert.Equal(t, c.expected, buf.String()) @@ -51,7 +51,7 @@ func TestStdLog(t *testing.T) { func TestStdLog_forceLevel(t *testing.T) { var buf bytes.Buffer - logger := New(shampoo.NewWriter(&buf, os.Environ())) + logger := New(colorprofile.NewWriter(&buf, os.Environ())) cases := []struct { name string expected string @@ -85,7 +85,7 @@ func TestStdLog_forceLevel(t *testing.T) { func TestStdLog_writer(t *testing.T) { var buf bytes.Buffer - logger := New(shampoo.NewWriter(&buf, os.Environ())) + logger := New(colorprofile.NewWriter(&buf, os.Environ())) logger.SetReportCaller(true) _, file, line, ok := runtime.Caller(0) require.True(t, ok) diff --git a/text_test.go b/text_test.go index 32a9658..de5c4b9 100644 --- a/text_test.go +++ b/text_test.go @@ -13,7 +13,7 @@ import ( "time" "github.com/charmbracelet/lipgloss" - "github.com/charmbracelet/shampoo" + "github.com/charmbracelet/colorprofile" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -24,14 +24,14 @@ func _zeroTime(time.Time) time.Time { func TestNilStyles(t *testing.T) { st := DefaultStyles() - l := New(shampoo.NewWriter(io.Discard, os.Environ())) + l := New(colorprofile.NewWriter(io.Discard, os.Environ())) l.SetStyles(nil) assert.Equal(t, st, l.styles) } func TestTextCaller(t *testing.T) { var buf bytes.Buffer - logger := New(shampoo.NewWriter(&buf, os.Environ())) + logger := New(colorprofile.NewWriter(&buf, os.Environ())) logger.SetReportCaller(true) // We calculate the caller offset based on the caller line number. _, file, line, _ := runtime.Caller(0) @@ -100,7 +100,7 @@ func TestTextCaller(t *testing.T) { func TestTextLogger(t *testing.T) { var buf bytes.Buffer - logger := New(shampoo.NewWriter(&buf, os.Environ())) + logger := New(colorprofile.NewWriter(&buf, os.Environ())) cases := []struct { name string expected string @@ -211,7 +211,7 @@ func TestTextLogger(t *testing.T) { func TestTextHelper(t *testing.T) { var buf bytes.Buffer - logger := New(shampoo.NewWriter(&buf, os.Environ())) + logger := New(colorprofile.NewWriter(&buf, os.Environ())) logger.SetReportCaller(true) helper := func() { logger.Helper() @@ -226,7 +226,7 @@ func TestTextHelper(t *testing.T) { func TestTextFatal(t *testing.T) { var buf bytes.Buffer - logger := New(shampoo.NewWriter(&buf, os.Environ())) + logger := New(colorprofile.NewWriter(&buf, os.Environ())) logger.SetReportCaller(true) if os.Getenv("FATAL") == "1" { logger.Fatal("i'm dead") @@ -244,8 +244,8 @@ func TestTextFatal(t *testing.T) { func TestTextValueStyles(t *testing.T) { var buf bytes.Buffer - w := shampoo.NewWriter(&buf, os.Environ()) - w.Profile = shampoo.ANSI256 + w := colorprofile.NewWriter(&buf, os.Environ()) + w.Profile = colorprofile.ANSI256 logger := New(w) st := DefaultStyles() st.Value = lipgloss.NewStyle().Bold(true) @@ -411,7 +411,7 @@ func TestTextValueStyles(t *testing.T) { func TestCustomLevelStyle(t *testing.T) { var buf bytes.Buffer - l := New(shampoo.NewWriter(&buf, os.Environ())) + l := New(colorprofile.NewWriter(&buf, os.Environ())) st := DefaultStyles() lvl := Level(1234) st.Levels[lvl] = lipgloss.NewStyle().Bold(true).SetString("FUNKY") From a697bd2d38b68173b614c760cacda5093d9673c0 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Mon, 28 Oct 2024 11:10:48 -0400 Subject: [PATCH 07/10] chore: use latest lipgloss v2-exp --- go.mod | 7 +++++-- go.sum | 11 +++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 30f1ec3..f4d52b3 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/charmbracelet/log go 1.19 require ( - github.com/charmbracelet/colorprofile v0.1.1 - github.com/charmbracelet/lipgloss v0.13.1-0.20240822211938-b89f1a3db2a4 + github.com/charmbracelet/colorprofile v0.1.2 + github.com/charmbracelet/lipgloss v0.13.2-0.20241023173701-23b08d1d3588 github.com/go-logfmt/logfmt v0.6.0 github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20231006140011-7918f672742d @@ -12,9 +12,12 @@ require ( require ( github.com/charmbracelet/x/ansi v0.3.2 // indirect + github.com/charmbracelet/x/input v0.2.0 // indirect github.com/charmbracelet/x/term v0.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect + github.com/muesli/cancelreader v0.2.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect diff --git a/go.sum b/go.sum index bac0850..df5fab9 100644 --- a/go.sum +++ b/go.sum @@ -1,17 +1,27 @@ github.com/charmbracelet/colorprofile v0.1.1 h1:YsvIsmZ2bazhejG+5g5MPPMpllc7Ks66Nk8l3IvGJ2g= github.com/charmbracelet/colorprofile v0.1.1/go.mod h1:1htIKZYeI4TQs+OykPvpuBTUbUJxBYeSYBDIZuejMj0= +github.com/charmbracelet/colorprofile v0.1.2 h1:nuB1bd/yAExT4fkcZvpqtQ2N5/8cJHSRIKb6CzT7lAM= +github.com/charmbracelet/colorprofile v0.1.2/go.mod h1:1htIKZYeI4TQs+OykPvpuBTUbUJxBYeSYBDIZuejMj0= github.com/charmbracelet/lipgloss v0.13.1-0.20240822211938-b89f1a3db2a4 h1:BuZojjzjQ89wObGNVxJzFqyeh2S6Crbwhybb8bZNveI= github.com/charmbracelet/lipgloss v0.13.1-0.20240822211938-b89f1a3db2a4/go.mod h1:ZbN5GVH/VrXHPRa1lZqZ1HWJyayJHJYaf9ywsCuI9zQ= +github.com/charmbracelet/lipgloss v0.13.2-0.20241023173701-23b08d1d3588 h1:P0eMGSpqhHhVEN9HRD9Dl0ZaXIJWHINkW4DjPC/0EIQ= +github.com/charmbracelet/lipgloss v0.13.2-0.20241023173701-23b08d1d3588/go.mod h1:S+zi6HCChYq08TKQZpf3KEi7D/RO62JjxwNXbv6KVxA= github.com/charmbracelet/x/ansi v0.3.2 h1:wsEwgAN+C9U06l9dCVMX0/L3x7ptvY1qmjMwyfE6USY= github.com/charmbracelet/x/ansi v0.3.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/x/input v0.2.0 h1:1Sv+y/flcqUfUH2PXNIDKDIdT2G8smOnGOgawqhwy8A= +github.com/charmbracelet/x/input v0.2.0/go.mod h1:KUSFIS6uQymtnr5lHVSOK9j8RvwTD4YHnWnzJUYnd/M= github.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0= github.com/charmbracelet/x/term v0.2.0/go.mod h1:GVxgxAbjUrmpvIINHIQnJJKpMlHiZ4cktEQCN6GWyF0= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= +github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= @@ -22,6 +32,7 @@ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavM github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= 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/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= From fa91da8504524dc494016b9f791cc7cc864b7b5b Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 18 Dec 2024 17:12:25 -0300 Subject: [PATCH 08/10] feat: use lipgloss/v2 (#149) * feat: use lipgloss/v2 Signed-off-by: Carlos Alexandro Becker * chore(deps): go mod tidy * feat!(deps): remove lipgloss renderer var --------- Signed-off-by: Carlos Alexandro Becker Co-authored-by: bashbunni --- examples/go.mod | 16 ++++++++------ examples/go.sum | 46 ++++++++++++++++++++++----------------- examples/styles/styles.go | 2 +- go.mod | 9 ++++---- go.sum | 21 ++++++++---------- pkg.go | 3 --- styles.go | 2 +- text_test.go | 2 +- 8 files changed, 51 insertions(+), 50 deletions(-) diff --git a/examples/go.mod b/examples/go.mod index f4b4374..ae855e4 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -5,19 +5,21 @@ go 1.17 replace github.com/charmbracelet/log => ../ require ( - github.com/charmbracelet/lipgloss v0.10.0 + github.com/charmbracelet/lipgloss/v2 v2.0.0-20241101153040-904e60506df7 github.com/charmbracelet/log v0.0.0-00010101000000-000000000000 ) require ( - github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect + github.com/charmbracelet/colorprofile v0.1.2 // indirect + github.com/charmbracelet/x/ansi v0.4.2 // indirect + github.com/charmbracelet/x/input v0.2.0 // indirect + github.com/charmbracelet/x/term v0.2.0 // indirect + github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/muesli/reflow v0.3.0 // indirect - github.com/muesli/termenv v0.15.2 // indirect + github.com/muesli/cancelreader v0.2.2 // indirect github.com/rivo/uniseg v0.4.7 // indirect + github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect - golang.org/x/sys v0.13.0 // indirect + golang.org/x/sys v0.26.0 // indirect ) diff --git a/examples/go.sum b/examples/go.sum index 2989617..c8a3b61 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -1,30 +1,31 @@ -github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= -github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= -github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= -github.com/charmbracelet/lipgloss v0.10.0 h1:KWeXFSexGcfahHX+54URiZGkBFazf70JNMtwg/AFW3s= -github.com/charmbracelet/lipgloss v0.10.0/go.mod h1:Wig9DSfvANsxqkRsqj6x87irdy123SR4dOXlKa91ciE= +github.com/aymanbagabas/go-udiff v0.2.0/go.mod h1:RE4Ex0qsGkTAJoQdQQCA0uG+nAzJO/pI/QwceO5fgrA= +github.com/charmbracelet/colorprofile v0.1.2 h1:nuB1bd/yAExT4fkcZvpqtQ2N5/8cJHSRIKb6CzT7lAM= +github.com/charmbracelet/colorprofile v0.1.2/go.mod h1:1htIKZYeI4TQs+OykPvpuBTUbUJxBYeSYBDIZuejMj0= +github.com/charmbracelet/lipgloss/v2 v2.0.0-20241101153040-904e60506df7 h1:od3rYcqNPhFzECY/xWPnHgSJF7WJdkB3inncDXpUCZ8= +github.com/charmbracelet/lipgloss/v2 v2.0.0-20241101153040-904e60506df7/go.mod h1:M8oXIuQtauwIZFuFREK6cYi+2fu0YNiBFnmCP7N8c2c= +github.com/charmbracelet/x/ansi v0.2.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/x/ansi v0.3.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/x/ansi v0.4.2 h1:0JM6Aj/g/KC154/gOP4vfxun0ff6itogDYk41kof+qk= +github.com/charmbracelet/x/ansi v0.4.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/x/exp/golden v0.0.0-20240806155701-69247e0abc2a/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U= +github.com/charmbracelet/x/input v0.2.0 h1:1Sv+y/flcqUfUH2PXNIDKDIdT2G8smOnGOgawqhwy8A= +github.com/charmbracelet/x/input v0.2.0/go.mod h1:KUSFIS6uQymtnr5lHVSOK9j8RvwTD4YHnWnzJUYnd/M= +github.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0= +github.com/charmbracelet/x/term v0.2.0/go.mod h1:GVxgxAbjUrmpvIINHIQnJJKpMlHiZ4cktEQCN6GWyF0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= -github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= -github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= -github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= -github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= +github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= +github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -36,11 +37,14 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= +github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= 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/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -62,15 +66,17 @@ golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= diff --git a/examples/styles/styles.go b/examples/styles/styles.go index 9e75e09..404ac09 100644 --- a/examples/styles/styles.go +++ b/examples/styles/styles.go @@ -4,7 +4,7 @@ import ( "os" "time" - "github.com/charmbracelet/lipgloss" + "github.com/charmbracelet/lipgloss/v2" "github.com/charmbracelet/log" ) diff --git a/go.mod b/go.mod index 36b7560..1be93ee 100644 --- a/go.mod +++ b/go.mod @@ -4,21 +4,20 @@ go 1.19 require ( github.com/charmbracelet/colorprofile v0.1.2 - github.com/charmbracelet/lipgloss v1.0.0 + github.com/charmbracelet/lipgloss/v2 v2.0.0-20241101153040-904e60506df7 github.com/go-logfmt/logfmt v0.6.0 github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20231006140011-7918f672742d ) require ( - github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/charmbracelet/x/ansi v0.4.2 // indirect + github.com/charmbracelet/x/input v0.2.0 // indirect github.com/charmbracelet/x/term v0.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/muesli/termenv v0.15.2 // indirect + github.com/muesli/cancelreader v0.2.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect diff --git a/go.sum b/go.sum index 614bfb5..c5f1bc0 100644 --- a/go.sum +++ b/go.sum @@ -1,28 +1,25 @@ -github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= -github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/charmbracelet/colorprofile v0.1.2 h1:nuB1bd/yAExT4fkcZvpqtQ2N5/8cJHSRIKb6CzT7lAM= github.com/charmbracelet/colorprofile v0.1.2/go.mod h1:1htIKZYeI4TQs+OykPvpuBTUbUJxBYeSYBDIZuejMj0= -github.com/charmbracelet/lipgloss v1.0.0 h1:O7VkGDvqEdGi93X+DeqsQ7PKHDgtQfF8j8/O2qFMQNg= -github.com/charmbracelet/lipgloss v1.0.0/go.mod h1:U5fy9Z+C38obMs+T+tJqst9VGzlOYGj4ri9reL3qUlo= +github.com/charmbracelet/lipgloss/v2 v2.0.0-20241101153040-904e60506df7 h1:od3rYcqNPhFzECY/xWPnHgSJF7WJdkB3inncDXpUCZ8= +github.com/charmbracelet/lipgloss/v2 v2.0.0-20241101153040-904e60506df7/go.mod h1:M8oXIuQtauwIZFuFREK6cYi+2fu0YNiBFnmCP7N8c2c= github.com/charmbracelet/x/ansi v0.4.2 h1:0JM6Aj/g/KC154/gOP4vfxun0ff6itogDYk41kof+qk= github.com/charmbracelet/x/ansi v0.4.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/x/input v0.2.0 h1:1Sv+y/flcqUfUH2PXNIDKDIdT2G8smOnGOgawqhwy8A= +github.com/charmbracelet/x/input v0.2.0/go.mod h1:KUSFIS6uQymtnr5lHVSOK9j8RvwTD4YHnWnzJUYnd/M= github.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0= github.com/charmbracelet/x/term v0.2.0/go.mod h1:GVxgxAbjUrmpvIINHIQnJJKpMlHiZ4cktEQCN6GWyF0= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= -github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= +github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= +github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= @@ -31,7 +28,7 @@ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavM github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= 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/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/pkg.go b/pkg.go index 1dee893..837a375 100644 --- a/pkg.go +++ b/pkg.go @@ -12,9 +12,6 @@ import ( ) var ( - // registry is a map of all registered lipgloss renderers. - registry = sync.Map{} - // defaultLogger is the default global logger instance. defaultLogger atomic.Pointer[Logger] defaultLoggerOnce sync.Once diff --git a/styles.go b/styles.go index 322d217..4f6890a 100644 --- a/styles.go +++ b/styles.go @@ -3,7 +3,7 @@ package log import ( "strings" - "github.com/charmbracelet/lipgloss" + "github.com/charmbracelet/lipgloss/v2" ) // Styles defines the styles for the text logger. diff --git a/text_test.go b/text_test.go index de5c4b9..447bb41 100644 --- a/text_test.go +++ b/text_test.go @@ -12,8 +12,8 @@ import ( "testing" "time" - "github.com/charmbracelet/lipgloss" "github.com/charmbracelet/colorprofile" + "github.com/charmbracelet/lipgloss/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) From 978e92235d710a999fea22f934096ff008a4f636 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 14 Jan 2025 13:52:31 -0300 Subject: [PATCH 09/10] fix: rename mod to /v2, update lipgloss Signed-off-by: Carlos Alexandro Becker --- examples/app/app.go | 2 +- examples/batch2/batch2.go | 2 +- examples/chocolate-chips/chocolate-chips.go | 2 +- examples/cookie/cookie.go | 2 +- examples/error/error.go | 2 +- examples/format/format.go | 2 +- examples/log/log.go | 2 +- examples/new/new.go | 2 +- examples/options/options.go | 2 +- examples/oven/oven.go | 2 +- examples/slog/main.go | 2 +- examples/styles/styles.go | 2 +- examples/temperature/temperature.go | 2 +- go.mod | 14 +++++------- go.sum | 25 +++++++++------------ 15 files changed, 29 insertions(+), 36 deletions(-) diff --git a/examples/app/app.go b/examples/app/app.go index 37ee108..9d50dea 100644 --- a/examples/app/app.go +++ b/examples/app/app.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/charmbracelet/log" + "github.com/charmbracelet/log/v2" ) type cup int diff --git a/examples/batch2/batch2.go b/examples/batch2/batch2.go index 3f68bcf..a5faa1e 100644 --- a/examples/batch2/batch2.go +++ b/examples/batch2/batch2.go @@ -1,7 +1,7 @@ package main import ( - "github.com/charmbracelet/log" + "github.com/charmbracelet/log/v2" ) func main() { diff --git a/examples/chocolate-chips/chocolate-chips.go b/examples/chocolate-chips/chocolate-chips.go index 52c12d3..91a9036 100644 --- a/examples/chocolate-chips/chocolate-chips.go +++ b/examples/chocolate-chips/chocolate-chips.go @@ -1,7 +1,7 @@ package main import ( - "github.com/charmbracelet/log" + "github.com/charmbracelet/log/v2" ) func main() { diff --git a/examples/cookie/cookie.go b/examples/cookie/cookie.go index 94da810..d074d6c 100644 --- a/examples/cookie/cookie.go +++ b/examples/cookie/cookie.go @@ -1,6 +1,6 @@ package main -import "github.com/charmbracelet/log" +import "github.com/charmbracelet/log/v2" func main() { log.Debug("Cookie 🍪") diff --git a/examples/error/error.go b/examples/error/error.go index 3bcbd22..493aa22 100644 --- a/examples/error/error.go +++ b/examples/error/error.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/charmbracelet/log" + "github.com/charmbracelet/log/v2" ) func main() { diff --git a/examples/format/format.go b/examples/format/format.go index 7dca763..f879ab9 100644 --- a/examples/format/format.go +++ b/examples/format/format.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/charmbracelet/log" + "github.com/charmbracelet/log/v2" ) func main() { diff --git a/examples/log/log.go b/examples/log/log.go index d8669f2..3e9c9ff 100644 --- a/examples/log/log.go +++ b/examples/log/log.go @@ -1,6 +1,6 @@ package main -import "github.com/charmbracelet/log" +import "github.com/charmbracelet/log/v2" func main() { log.Print("Baking 101") diff --git a/examples/new/new.go b/examples/new/new.go index 06c69c8..7006173 100644 --- a/examples/new/new.go +++ b/examples/new/new.go @@ -3,7 +3,7 @@ package main import ( "os" - "github.com/charmbracelet/log" + "github.com/charmbracelet/log/v2" ) func main() { diff --git a/examples/options/options.go b/examples/options/options.go index 83d5388..5d8cf88 100644 --- a/examples/options/options.go +++ b/examples/options/options.go @@ -4,7 +4,7 @@ import ( "os" "time" - "github.com/charmbracelet/log" + "github.com/charmbracelet/log/v2" ) func main() { diff --git a/examples/oven/oven.go b/examples/oven/oven.go index 19e68aa..f9dbaa6 100644 --- a/examples/oven/oven.go +++ b/examples/oven/oven.go @@ -1,6 +1,6 @@ package main -import "github.com/charmbracelet/log" +import "github.com/charmbracelet/log/v2" func startOven(degree int) { log.Helper() diff --git a/examples/slog/main.go b/examples/slog/main.go index f25b2e6..6933531 100644 --- a/examples/slog/main.go +++ b/examples/slog/main.go @@ -6,7 +6,7 @@ import ( "os" "time" - "github.com/charmbracelet/log" + "github.com/charmbracelet/log/v2" ) func main() { diff --git a/examples/styles/styles.go b/examples/styles/styles.go index 404ac09..ba4861a 100644 --- a/examples/styles/styles.go +++ b/examples/styles/styles.go @@ -5,7 +5,7 @@ import ( "time" "github.com/charmbracelet/lipgloss/v2" - "github.com/charmbracelet/log" + "github.com/charmbracelet/log/v2" ) func main() { diff --git a/examples/temperature/temperature.go b/examples/temperature/temperature.go index 20f522c..679964f 100644 --- a/examples/temperature/temperature.go +++ b/examples/temperature/temperature.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/charmbracelet/log" + "github.com/charmbracelet/log/v2" ) func main() { diff --git a/go.mod b/go.mod index 1be93ee..387678e 100644 --- a/go.mod +++ b/go.mod @@ -1,26 +1,24 @@ -module github.com/charmbracelet/log +module github.com/charmbracelet/log/v2 go 1.19 require ( - github.com/charmbracelet/colorprofile v0.1.2 - github.com/charmbracelet/lipgloss/v2 v2.0.0-20241101153040-904e60506df7 + github.com/charmbracelet/colorprofile v0.1.8 + github.com/charmbracelet/lipgloss/v2 v2.0.0-alpha.2.0.20241204155804-59cbf2850015 github.com/go-logfmt/logfmt v0.6.0 github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20231006140011-7918f672742d ) require ( - github.com/charmbracelet/x/ansi v0.4.2 // indirect - github.com/charmbracelet/x/input v0.2.0 // indirect - github.com/charmbracelet/x/term v0.2.0 // indirect + github.com/charmbracelet/x/ansi v0.6.0 // indirect + github.com/charmbracelet/x/term v0.2.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/muesli/cancelreader v0.2.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect - golang.org/x/sys v0.26.0 // indirect + golang.org/x/sys v0.28.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index c5f1bc0..05bd99f 100644 --- a/go.sum +++ b/go.sum @@ -1,17 +1,13 @@ -github.com/charmbracelet/colorprofile v0.1.2 h1:nuB1bd/yAExT4fkcZvpqtQ2N5/8cJHSRIKb6CzT7lAM= -github.com/charmbracelet/colorprofile v0.1.2/go.mod h1:1htIKZYeI4TQs+OykPvpuBTUbUJxBYeSYBDIZuejMj0= -github.com/charmbracelet/lipgloss/v2 v2.0.0-20241101153040-904e60506df7 h1:od3rYcqNPhFzECY/xWPnHgSJF7WJdkB3inncDXpUCZ8= -github.com/charmbracelet/lipgloss/v2 v2.0.0-20241101153040-904e60506df7/go.mod h1:M8oXIuQtauwIZFuFREK6cYi+2fu0YNiBFnmCP7N8c2c= -github.com/charmbracelet/x/ansi v0.4.2 h1:0JM6Aj/g/KC154/gOP4vfxun0ff6itogDYk41kof+qk= -github.com/charmbracelet/x/ansi v0.4.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= -github.com/charmbracelet/x/input v0.2.0 h1:1Sv+y/flcqUfUH2PXNIDKDIdT2G8smOnGOgawqhwy8A= -github.com/charmbracelet/x/input v0.2.0/go.mod h1:KUSFIS6uQymtnr5lHVSOK9j8RvwTD4YHnWnzJUYnd/M= -github.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0= -github.com/charmbracelet/x/term v0.2.0/go.mod h1:GVxgxAbjUrmpvIINHIQnJJKpMlHiZ4cktEQCN6GWyF0= +github.com/charmbracelet/colorprofile v0.1.8 h1:PywDeXsiAzlPtkiiKgMEVLvb6nlEuKrMj9+FJBtj4jU= +github.com/charmbracelet/colorprofile v0.1.8/go.mod h1:+jpmObxZl1Dab3H3IMVIPSZTsKcFpjJUv97G0dLqM60= +github.com/charmbracelet/lipgloss/v2 v2.0.0-alpha.2.0.20241204155804-59cbf2850015 h1:adBE3DiFDXiklwG9LqTDPmJaEbZoHzjmiMLwiWaB/Fs= +github.com/charmbracelet/lipgloss/v2 v2.0.0-alpha.2.0.20241204155804-59cbf2850015/go.mod h1:F/6E/LGdH3eHCJf2rG8/O3CjlW8cZFL5YJCknJs1GkI= +github.com/charmbracelet/x/ansi v0.6.0 h1:qOznutrb93gx9oMiGf7caF7bqqubh6YIM0SWKyA08pA= +github.com/charmbracelet/x/ansi v0.6.0/go.mod h1:KBUFw1la39nl0dLl10l5ORDAqGXaeurTQmwyyVKse/Q= +github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= +github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= -github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= @@ -28,9 +24,8 @@ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavM github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= 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/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= -golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From 9353d56a9b8850fe5024fd8ad3f1f4823f144e88 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 15 Jan 2025 12:32:07 -0300 Subject: [PATCH 10/10] chore(deps): update Signed-off-by: Carlos Alexandro Becker --- examples/go.mod | 16 +++++++--------- examples/go.sum | 32 +++++++++++++++----------------- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 4 files changed, 34 insertions(+), 38 deletions(-) diff --git a/examples/go.mod b/examples/go.mod index ae855e4..db9b59b 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -2,24 +2,22 @@ module examples go 1.17 -replace github.com/charmbracelet/log => ../ +replace github.com/charmbracelet/log/v2 => ../ require ( - github.com/charmbracelet/lipgloss/v2 v2.0.0-20241101153040-904e60506df7 - github.com/charmbracelet/log v0.0.0-00010101000000-000000000000 + github.com/charmbracelet/lipgloss/v2 v2.0.0-alpha.2.0.20250114171829-b67eb015d607 + github.com/charmbracelet/log/v2 v2.0.0-00010101000000-000000000000 ) require ( - github.com/charmbracelet/colorprofile v0.1.2 // indirect - github.com/charmbracelet/x/ansi v0.4.2 // indirect - github.com/charmbracelet/x/input v0.2.0 // indirect - github.com/charmbracelet/x/term v0.2.0 // indirect - github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect + github.com/charmbracelet/colorprofile v0.1.9 // indirect + github.com/charmbracelet/x/ansi v0.7.0 // indirect + github.com/charmbracelet/x/term v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/muesli/cancelreader v0.2.2 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect - golang.org/x/sys v0.26.0 // indirect + golang.org/x/sys v0.29.0 // indirect ) diff --git a/examples/go.sum b/examples/go.sum index c8a3b61..0c88780 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -1,22 +1,19 @@ github.com/aymanbagabas/go-udiff v0.2.0/go.mod h1:RE4Ex0qsGkTAJoQdQQCA0uG+nAzJO/pI/QwceO5fgrA= -github.com/charmbracelet/colorprofile v0.1.2 h1:nuB1bd/yAExT4fkcZvpqtQ2N5/8cJHSRIKb6CzT7lAM= -github.com/charmbracelet/colorprofile v0.1.2/go.mod h1:1htIKZYeI4TQs+OykPvpuBTUbUJxBYeSYBDIZuejMj0= -github.com/charmbracelet/lipgloss/v2 v2.0.0-20241101153040-904e60506df7 h1:od3rYcqNPhFzECY/xWPnHgSJF7WJdkB3inncDXpUCZ8= -github.com/charmbracelet/lipgloss/v2 v2.0.0-20241101153040-904e60506df7/go.mod h1:M8oXIuQtauwIZFuFREK6cYi+2fu0YNiBFnmCP7N8c2c= -github.com/charmbracelet/x/ansi v0.2.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= -github.com/charmbracelet/x/ansi v0.3.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= -github.com/charmbracelet/x/ansi v0.4.2 h1:0JM6Aj/g/KC154/gOP4vfxun0ff6itogDYk41kof+qk= -github.com/charmbracelet/x/ansi v0.4.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/colorprofile v0.1.8/go.mod h1:+jpmObxZl1Dab3H3IMVIPSZTsKcFpjJUv97G0dLqM60= +github.com/charmbracelet/colorprofile v0.1.9 h1:5JnfvX+I9D6rRNu8xK3pgIqknaBVTXHU9pGu1jkZxLw= +github.com/charmbracelet/colorprofile v0.1.9/go.mod h1:+jpmObxZl1Dab3H3IMVIPSZTsKcFpjJUv97G0dLqM60= +github.com/charmbracelet/lipgloss/v2 v2.0.0-alpha.2.0.20250114171829-b67eb015d607 h1:lERE4ow371r5WMqQAt7Eqlg1A4tBNA8T4RLwdXnKyBo= +github.com/charmbracelet/lipgloss/v2 v2.0.0-alpha.2.0.20250114171829-b67eb015d607/go.mod h1:MD7Vb+O1zFRgBo+F94JHHuME7df8XBByNKuX5k/L/qs= +github.com/charmbracelet/x/ansi v0.5.0/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/x/ansi v0.6.0/go.mod h1:KBUFw1la39nl0dLl10l5ORDAqGXaeurTQmwyyVKse/Q= +github.com/charmbracelet/x/ansi v0.7.0 h1:/QfFmiXOGGwN6fRbzvQaYp7fu1pkxpZ3qFBZWBsP404= +github.com/charmbracelet/x/ansi v0.7.0/go.mod h1:KBUFw1la39nl0dLl10l5ORDAqGXaeurTQmwyyVKse/Q= github.com/charmbracelet/x/exp/golden v0.0.0-20240806155701-69247e0abc2a/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U= -github.com/charmbracelet/x/input v0.2.0 h1:1Sv+y/flcqUfUH2PXNIDKDIdT2G8smOnGOgawqhwy8A= -github.com/charmbracelet/x/input v0.2.0/go.mod h1:KUSFIS6uQymtnr5lHVSOK9j8RvwTD4YHnWnzJUYnd/M= -github.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0= -github.com/charmbracelet/x/term v0.2.0/go.mod h1:GVxgxAbjUrmpvIINHIQnJJKpMlHiZ4cktEQCN6GWyF0= +github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= +github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= -github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -66,7 +63,6 @@ golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -74,9 +70,11 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= diff --git a/go.mod b/go.mod index 387678e..a289f18 100644 --- a/go.mod +++ b/go.mod @@ -3,15 +3,15 @@ module github.com/charmbracelet/log/v2 go 1.19 require ( - github.com/charmbracelet/colorprofile v0.1.8 - github.com/charmbracelet/lipgloss/v2 v2.0.0-alpha.2.0.20241204155804-59cbf2850015 + github.com/charmbracelet/colorprofile v0.1.9 + github.com/charmbracelet/lipgloss/v2 v2.0.0-alpha.2.0.20250114171829-b67eb015d607 github.com/go-logfmt/logfmt v0.6.0 github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20231006140011-7918f672742d ) require ( - github.com/charmbracelet/x/ansi v0.6.0 // indirect + github.com/charmbracelet/x/ansi v0.7.0 // indirect github.com/charmbracelet/x/term v0.2.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect @@ -19,6 +19,6 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 05bd99f..4a5f240 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,9 @@ -github.com/charmbracelet/colorprofile v0.1.8 h1:PywDeXsiAzlPtkiiKgMEVLvb6nlEuKrMj9+FJBtj4jU= -github.com/charmbracelet/colorprofile v0.1.8/go.mod h1:+jpmObxZl1Dab3H3IMVIPSZTsKcFpjJUv97G0dLqM60= -github.com/charmbracelet/lipgloss/v2 v2.0.0-alpha.2.0.20241204155804-59cbf2850015 h1:adBE3DiFDXiklwG9LqTDPmJaEbZoHzjmiMLwiWaB/Fs= -github.com/charmbracelet/lipgloss/v2 v2.0.0-alpha.2.0.20241204155804-59cbf2850015/go.mod h1:F/6E/LGdH3eHCJf2rG8/O3CjlW8cZFL5YJCknJs1GkI= -github.com/charmbracelet/x/ansi v0.6.0 h1:qOznutrb93gx9oMiGf7caF7bqqubh6YIM0SWKyA08pA= -github.com/charmbracelet/x/ansi v0.6.0/go.mod h1:KBUFw1la39nl0dLl10l5ORDAqGXaeurTQmwyyVKse/Q= +github.com/charmbracelet/colorprofile v0.1.9 h1:5JnfvX+I9D6rRNu8xK3pgIqknaBVTXHU9pGu1jkZxLw= +github.com/charmbracelet/colorprofile v0.1.9/go.mod h1:+jpmObxZl1Dab3H3IMVIPSZTsKcFpjJUv97G0dLqM60= +github.com/charmbracelet/lipgloss/v2 v2.0.0-alpha.2.0.20250114171829-b67eb015d607 h1:lERE4ow371r5WMqQAt7Eqlg1A4tBNA8T4RLwdXnKyBo= +github.com/charmbracelet/lipgloss/v2 v2.0.0-alpha.2.0.20250114171829-b67eb015d607/go.mod h1:MD7Vb+O1zFRgBo+F94JHHuME7df8XBByNKuX5k/L/qs= +github.com/charmbracelet/x/ansi v0.7.0 h1:/QfFmiXOGGwN6fRbzvQaYp7fu1pkxpZ3qFBZWBsP404= +github.com/charmbracelet/x/ansi v0.7.0/go.mod h1:KBUFw1la39nl0dLl10l5ORDAqGXaeurTQmwyyVKse/Q= github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -24,8 +24,8 @@ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavM github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= 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/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=