Commit Graph

77 Commits

Author SHA1 Message Date
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
Kevin Wan
de5ed6a677 feat: support %w in logx.Errorf (#1278) 2021-11-26 15:57:23 +08:00
Kevin Wan
fa4dc151ca test: add more tests (#1134) 2021-10-13 22:42:54 +08:00
Kevin Wan
10e7922597 feat: opentelemetry integration, removed self designed tracing (#1111)
* feat: opentelemetry integration, removed self designed tracing

* feat: support zipkin on opentelemetry integration

* feat: support zipkin on opentelemetry integration, enable it in conf

* style: format code

* fix: support logx without exporter configured

* fix: check return values

* refactor: simplify code

* refactor: simplify opentelemetry integration

* ci: fix staticcheck errors
2021-10-03 20:53:50 +08:00
Kevin Wan
ed15ca04f4 fix: opentelemetry traceid not correct (#1108) 2021-10-01 22:44:37 +08:00
Kevin Wan
65905b914d ci: add reviewdog (#1096) 2021-09-29 13:09:20 +08:00
Kevin Wan
872c50b71a chore: make comment accurate (#1055) 2021-09-17 11:11:42 +08:00
Kevin Wan
f4bb9f5635 fix test error on ubuntu (#1048) 2021-09-15 13:31:20 +08:00
Kevin Wan
10805577f5 reorg imports, format code (#1000) 2021-09-06 14:56:46 +08:00
SunJun
a4d8286e36 开启otel后,tracelog自动获取otle的traceId和spanId (#946)
* 开启otel后,tracelog自动获取otle的traceId和spanId

* 去除opentelemetry判断

* 通过 IsRecording 判断span是否活跃
2021-09-06 14:31:54 +08:00
Kevin Wan
fbf2eebc42 add Errorv/Infov/Slowv (#909) 2021-08-13 18:28:39 +08:00
Kevin Wan
1fb356f328 refactor goctl (#902) 2021-08-11 18:04:42 +08:00