Commit Graph

88 Commits

Author SHA1 Message Date
Kevin Wan
9941055eaa
feat: add trace.SpanIDFromContext and trace.TraceIDFromContext (#2654) 2022-12-02 11:00:44 +08:00
edieruby
b1c3c21c81
fix: log currentSize should not be 0 when file exists and size is not 0 (#2639) 2022-11-25 23:48:32 +08:00
Kevin Wan
7eb6aae949
fix: potential slice append issue (#2560) 2022-10-28 08:14:03 +08:00
Kevin Wan
06e4914e41
feat: add logger.WithFields (#2546) 2022-10-22 23:28:34 +08:00
Kevin Wan
d4c9fd2aff
chore: add golangci-lint config file (#2519)
* chore: add golangci-lint config file

* chore: member alignment
2022-10-14 22:45:48 +08:00
Kevin Wan
59c0013cd1
feat: add logc package, support AddGlobalFields for both logc and logx. (#2463)
* feat: add logc package

* feat: add logc, add AddGlobalFields for both logc and logx

* chore: add benchmarks

* chore: add more tests

* chore: simplify globalFields in logx

* chore: remove outdated comments
2022-09-29 22:49:41 +08:00
chen quan
2e1e4f3574
feat: add color to debug (#2433) 2022-09-21 22:30:06 +08:00
Kevin Wan
22d0a2120a
chore: replace fmt.Fprint (#2425) 2022-09-20 23:51:58 +08:00
chen quan
68e15360c2
fix: fix log output (#2424) 2022-09-20 22:45:52 +08:00
MarkJoyMa
e6aa6fc361
feat: add log debug level (#2411) 2022-09-20 07:50:11 +08:00
Kevin Wan
0b1884b6bd
feat: support caller skip in logx (#2401)
* feat: support caller skip in logx

* chore: remove debug prints

* chore: remove debug prints

* chore(deps): bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc (#2402)

Bumps [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc](https://github.com/open-telemetry/opentelemetry-go) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: simplify test code

* chore: remove new WithFields in logx, and deprecated old WithFields

* chore: simplify WithDuration

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-17 22:48:24 +08:00
Kevin Wan
d935c83a54
feat: support baggage propagation in httpc (#2375)
* feat: support baggage propagation in httpc

* chore: use go 1.16

* chore: use go 1.16

* chore: use go ^1.16

* chore: remove deprecated
2022-09-10 15:18:52 +08:00
Kevin Wan
dfeef5e497
fix: thread-safe in getWriter of logx (#2319) 2022-08-29 08:32:17 +08:00
Archer
8c72136631
make logx#getWriter concurrency-safe (#2233)
* make logx#getWriter concurrency-safe

* make logx#getWriter concurrency-safe
2022-08-28 22:10:50 +08:00
Kevin Wan
2d60f0c65a
fix: logx disable not working in some cases (#2306)
* fix: logx disable not working in some cases

* fix: test fail
2022-08-27 19:24:31 +08:00
chen quan
847a396f1c
fix(logx): display garbled characters in windows(DOS, Powershell) (#2232)
* fix(logx): display garbled characters in windows(DOS, Powershell)

* Update writer.go
2022-08-23 22:45:11 +08:00
Kevin Wan
05dd6bd743
chore: refactor logx (#2262) 2022-08-14 13:58:06 +08:00
chen quan
4fad067a0e
fix(logx): need to wait for the first caller to complete the execution. (#2213) 2022-08-03 23:59:39 +08:00
Kevin Wan
5cd9229986
fix: only setup logx once (#2188)
* fix: only setup logx once

* fix: test failure

* chore: not reset logging level in reset

* chore: refactoring
2022-07-28 22:08:48 +08:00
施国鹏
3d38d36605
fix: logx test foo (#2144)
constant testlog "Stay hungry, stay foolish." contains foo(foolish), changed to foo1
2022-07-28 21:29:56 +08:00
Kevin Wan
9b334b5428
chore: let logx.SetWriter can be called anytime (#2186) 2022-07-24 14:15:57 +08:00
Kevin Wan
92145b56dc
chore: refactoring (#2182) 2022-07-22 23:16:38 +08:00
Kevin Wan
34eb3fc12e
chore: refactoring logx (#2181) 2022-07-22 22:28:01 +08:00
SgtDaJim
101304be53
feat: logx support logs rotation based on size limitation. (#1652) (#2167)
* feat: logx support logs rotation based on size limitation. (#1652)

implementation of #1652

Totally compatible with the old logx.LogConf. No effect if users do not change their options.

* feat: logx support logs rotation based on size limitation. (#1652)

implementation of #1652

Totally compatible with the old logx.LogConf. No effect if users do not change their options.

* feat: logx support logs rotation based on size limitation. (#1652)

implementation of #1652

Totally compatible with the old logx.LogConf. No effect if users do not change their options.

* feat: logx support logs rotation based on size limitation. (#1652)

implementation of #1652

Totally compatible with the old logx.LogConf. No effect if users do not change their options.
2022-07-22 21:13:10 +08:00
Kevin Wan
24787a946b
feat: support logx.WithFields (#2128) 2022-07-11 23:19:26 +08:00
Kevin Wan
1d95e95cf8
chore: make methods consistent in signatures (#1971)
* chore: make methods consistent in signatures

* test: fix fails
2022-06-05 12:56:13 +08:00
Kevin Wan
c44edd7cac
test: fix fails (#1970) 2022-06-05 11:51:21 +08:00
Kevin Wan
af05219b70
test: make tests stable (#1968)
* test: make tests stable

* test: fix fails
2022-06-04 23:46:29 +08:00
Kevin Wan
6c94e4652e
chore: better mongo logs (#1965)
* chore: better mongo logs

* chore: add comments
2022-06-04 16:11:31 +08:00
Kevin Wan
7868bdf660
Chore/goctl version (#1962)
* chore: update version to v1.3.7

* docs: update migrate versions

* chore: remove debug prints

* chore: remove debug prints
2022-06-03 20:46:21 +08:00
Kevin Wan
bb33a20bc8
Update readme-cn.md 2022-06-03 19:18:58 +08:00
Kevin Wan
5536473a08
Update readme.md 2022-06-03 19:18:07 +08:00
Kevin Wan
30958a91f7
docs: add docs for logx (#1960) 2022-06-03 19:11:06 +08:00
Kevin Wan
321a20add6
chore: update roadmap (#1948) 2022-06-02 09:28:29 +08:00
chen quan
fd12659729
chore: add release action to auto build binaries (#1884)
* chore: add release action to auto build binaries

Signed-off-by: chenquan <chenquan.dev@gmail.com>

* fix: test bugs

Signed-off-by: chenquan <chenquan.dev@gmail.com>
2022-05-25 23:42:24 +08:00
Kevin Wan
e80a64fa67
feat: support WithStreamClientInterceptor for zrpc clients (#1907)
* feat: support WithStreamClientInterceptor for zrpc clients

* fix: data race
2022-05-14 19:58:17 +08:00
Kevin Wan
6d2b9fd904
chore: improve codecov (#1878) 2022-05-08 13:17:48 +08:00
Kevin Wan
69c2bad410
feat: logx with color (#1872)
* feat: logx with color

* chore: update logs

* fix test error

* chore: change colors of http codes

* chore: add comments

* chore: use faith/color instead of ascii code color

* chore: update colors

* chore: update colors

* chore: fix duplicated slowcall text

* chore: remove slowcall colors
2022-05-07 23:22:39 +08:00
Kevin Wan
d0a59b13a6
chore: fix deprecated usages (#1871)
* add conf documents

* chore: use {} instead of () for environment variables

* chore: fix deprecated usages

* chore: fix unstable tests

* chore: show stack on github actions
2022-05-06 15:13:46 +08:00
Kevin Wan
a36d58aac9
fix time, duration, slice types on logx.Field (#1868)
* chore: refine tests

* fix #1866
2022-05-05 23:37:18 +08:00
Kevin Wan
aa5118c2aa
chore: refine tests (#1864) 2022-05-04 17:52:58 +08:00
Kevin Wan
bab72b7630
chore: use time.Now() instead of timex.Time() because go optimized it (#1860) 2022-05-03 19:51:47 +08:00
Kevin Wan
ac321fc146
feat: add fields with logx methods, support using third party logging libs. (#1847)
* backup

* simplify

* chore: remove unused pool

* chore: fix lint errors

* chore: use strings.Builder instead of bytes.Buffer

* test: add more tests

* chore: fix reviewdog

* test: fix data race

* feat: make logger customizable

* chore: fix reviewdog

* test: fix fails

* chore: fix set writer twice

* chore: use context instead of golang.org context

* chore: specify uint32 for level types
2022-05-03 17:34:26 +08:00
Kevin Wan
5bcee4cf7c
fix #1806 (#1833)
* fix #1806

* chore: refine error text
2022-04-27 00:01:31 +08:00
Kevin Wan
259a5a13e7
chore: fix data race (#1593) 2022-02-28 23:17:51 +08:00
Fyn
cf7c7cb392
build: update goctl dependency ddl-parser to v1.0.3 (#1586)
* build: update goctl dependency ddl-parser to v1.0.3

* fix: race condition when testing logx

Resolves: #1587
2022-02-28 17:31:59 +08:00
Kevin Wan
cf4321b2d0
fix #1525 (#1527) 2022-02-11 23:04:57 +08:00
Kevin Wan
bf2feee5b7
feat: implement console plain output for debug logs (#1456)
* feat: implement console plain output for debug logs

* chore: rename console encoding to plain

* chore: refactor names
2022-01-17 12:43:15 +08:00
Kevin Wan
a91c3907a8
feat: rename module from tal-tech to zeromicro (#1413) 2022-01-04 15:51:32 +08:00
Kevin Wan
914692cc82
fix #1309 (#1317) 2021-12-13 11:58:58 +08:00