Skip to content

Commit

Permalink
./low -> hacked/low
Browse files Browse the repository at this point in the history
  • Loading branch information
nikandfor committed Jul 17, 2023
1 parent b140925 commit de9748a
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 53 deletions.
7 changes: 4 additions & 3 deletions console.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ import (
"github.com/nikandfor/errors"
"github.com/nikandfor/hacked/hfmt"
"github.com/nikandfor/hacked/htime"
"github.com/nikandfor/hacked/low"
"github.com/nikandfor/loc"
"golang.org/x/term"

"tlog.app/go/tlog/low"
tlow "tlog.app/go/tlog/low"
"tlog.app/go/tlog/tlwire"
)

Expand Down Expand Up @@ -636,7 +637,7 @@ func (w *ConsoleWriter) appendPair(b, p, k []byte, st int) (_ []byte, i int) {
b = append(b, ResetColor...)
}

nw := w.pad[low.UnsafeBytesToString(k)]
nw := w.pad[tlow.UnsafeBytesToString(k)]

if vw < nw {
w.addpad = nw - vw
Expand Down Expand Up @@ -724,7 +725,7 @@ func (w *ConsoleWriter) ConvertValue(b, p []byte, st, ff int) (_ []byte, i int)
}

if quote {
ss := low.UnsafeBytesToString(s)
ss := tlow.UnsafeBytesToString(s)
b = strconv.AppendQuote(b, ss)
} else {
b = append(b, s...)
Expand Down
2 changes: 1 addition & 1 deletion console_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"time"

"github.com/nikandfor/assert"
"github.com/nikandfor/hacked/low"
"github.com/nikandfor/loc"

"tlog.app/go/tlog/low"
"tlog.app/go/tlog/tlwire"
)

Expand Down
3 changes: 1 addition & 2 deletions context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import (
"testing"

"github.com/nikandfor/assert"

"tlog.app/go/tlog/low"
"github.com/nikandfor/hacked/low"
)

func TestContextWithSpan(t *testing.T) {
Expand Down
9 changes: 5 additions & 4 deletions convert/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import (
"time"

"github.com/nikandfor/hacked/hfmt"
"github.com/nikandfor/hacked/low"
"github.com/nikandfor/loc"

"tlog.app/go/tlog"
"tlog.app/go/tlog/low"
tlow "tlog.app/go/tlog/low"
"tlog.app/go/tlog/tlwire"
)

Expand Down Expand Up @@ -96,7 +97,7 @@ more:

if !renamed {
if w.AppendKeySafe {
b = low.AppendSafe(b, k)
b = tlow.AppendSafe(b, k)
} else {
b = append(b, k...)
}
Expand Down Expand Up @@ -154,7 +155,7 @@ func (w *JSON) ConvertValue(b, p []byte, st int) (_ []byte, i int) {
case tlwire.String:
b = append(b, '"')

b = low.AppendSafe(b, p[i:i+int(sub)])
b = tlow.AppendSafe(b, p[i:i+int(sub)])

b = append(b, '"')

Expand Down Expand Up @@ -194,7 +195,7 @@ func (w *JSON) ConvertValue(b, p []byte, st int) (_ []byte, i int) {
b = append(b, '"')

if w.AppendKeySafe {
b = low.AppendSafe(b, k)
b = tlow.AppendSafe(b, k)
} else {
b = append(b, k...)
}
Expand Down
2 changes: 1 addition & 1 deletion convert/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"testing"
"time"

"github.com/nikandfor/hacked/low"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"tlog.app/go/tlog"
"tlog.app/go/tlog/low"
"tlog.app/go/tlog/tlwire"
)

Expand Down
11 changes: 6 additions & 5 deletions convert/logfmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import (
"time"

"github.com/nikandfor/hacked/hfmt"
"github.com/nikandfor/hacked/low"
"github.com/nikandfor/loc"
"golang.org/x/term"

"tlog.app/go/tlog"
"tlog.app/go/tlog/low"
tlow "tlog.app/go/tlog/low"
"tlog.app/go/tlog/tlio"
"tlog.app/go/tlog/tlwire"
)
Expand Down Expand Up @@ -179,7 +180,7 @@ func (w *Logfmt) appendPair(b, p, k []byte, st int, first bool) (_ []byte, i int
b = append(b, tlog.ResetColor...)
}

nw := w.pad[low.UnsafeBytesToString(k)]
nw := w.pad[tlow.UnsafeBytesToString(k)]

if vw < nw {
w.addpad = nw - vw
Expand Down Expand Up @@ -316,10 +317,10 @@ func (w *Logfmt) appendAndQuote(b, s []byte, tag byte) []byte {

switch {
case quote:
ss := low.UnsafeBytesToString(s)
ss := tlow.UnsafeBytesToString(s)
b = strconv.AppendQuote(b, ss)
case w.AppendKeySafe:
b = low.AppendSafe(b, s)
b = tlow.AppendSafe(b, s)
default:
b = append(b, s...)
}
Expand Down Expand Up @@ -368,7 +369,7 @@ func (w *Logfmt) convertArray(b, p, k []byte, st int, first bool) (_ []byte, i i
k, i = w.d.Bytes(p, i)

if w.AppendKeySafe {
b = low.AppendSafe(b, k)
b = tlow.AppendSafe(b, k)
} else {
b = append(b, k...)
}
Expand Down
2 changes: 1 addition & 1 deletion convert/logfmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"testing"
"time"

"github.com/nikandfor/hacked/low"
"github.com/stretchr/testify/assert"

"tlog.app/go/tlog"
"tlog.app/go/tlog/low"
"tlog.app/go/tlog/tlwire"
)

Expand Down
2 changes: 1 addition & 1 deletion convert/rewriter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"time"

"github.com/nikandfor/assert"
"github.com/nikandfor/hacked/low"
"github.com/nikandfor/loc"

"tlog.app/go/tlog"
"tlog.app/go/tlog/low"
"tlog.app/go/tlog/tlwire"
)

Expand Down
27 changes: 0 additions & 27 deletions low/buf.go

This file was deleted.

2 changes: 1 addition & 1 deletion rotated/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"testing"

"github.com/nikandfor/assert"
"github.com/nikandfor/hacked/low"

"tlog.app/go/tlog"
"tlog.app/go/tlog/low"
"tlog.app/go/tlog/tlwire"
)

Expand Down
2 changes: 1 addition & 1 deletion tlio/writers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (

"github.com/nikandfor/assert"
"github.com/nikandfor/errors"
"github.com/nikandfor/hacked/low"

"tlog.app/go/tlog"
"tlog.app/go/tlog/low"
"tlog.app/go/tlog/tlwire"
)

Expand Down
2 changes: 1 addition & 1 deletion tlog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"testing"

"github.com/nikandfor/assert"
"github.com/nikandfor/hacked/low"
"github.com/nikandfor/loc"

"tlog.app/go/tlog/low"
"tlog.app/go/tlog/tlwire"
)

Expand Down
3 changes: 1 addition & 2 deletions tlwire/dumper.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import (
"io"

"github.com/nikandfor/hacked/hfmt"

"tlog.app/go/tlog/low"
"github.com/nikandfor/hacked/low"
)

type (
Expand Down
3 changes: 1 addition & 2 deletions tlwire/encoder_value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import (
"testing"

"github.com/nikandfor/assert"

"tlog.app/go/tlog/low"
"github.com/nikandfor/hacked/low"
)

type testEncoder struct {
Expand Down
2 changes: 1 addition & 1 deletion wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"unicode/utf8"
_ "unsafe"

"github.com/nikandfor/hacked/low"
"github.com/nikandfor/loc"

"tlog.app/go/tlog/low"
"tlog.app/go/tlog/tlwire"
)

Expand Down

0 comments on commit de9748a

Please sign in to comment.