Commit graph

18 commits

Author SHA1 Message Date
Daniel Liu
54f8e028ca log: fix some functions comments (#29907)
updates some docstrings
---------

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2024-11-15 10:02:43 +08:00
Daniel Liu
946c085f9f log: use native log/slog instead of golang/exp (#29302) 2024-11-15 10:02:42 +08:00
Daniel Liu
20a62e4743 log: add Handler getter to Logger interface (#28793)
log: Add Handler getter to Logger interface
2024-11-15 10:02:42 +08:00
Daniel Liu
966a03f297 log: emit error level string as "error", not "eror" (#28774) 2024-11-15 10:02:42 +08:00
Daniel Liu
14acdf2dd1 log: remove lazy, remove unused interfaces, unexport methods (#28622)
This change

- Removes interface `log.Format`,
- Removes method `log.FormatFunc`,
- unexports `TerminalHandler.TerminalFormat` formatting methods (renamed to `TerminalHandler.format`)
- removes the notion of `log.Lazy` values

The lazy handler was useful in the old log package, since it
could defer the evaluation of costly attributes until later in the
log pipeline: thus, if the logging was done at 'Trace', we could
skip evaluation if logging only was set to 'Info'.

With the move to slog, this way of deferring evaluation is no longer
needed, since slog introduced 'Enabled': the caller can thus do
the evaluate-or-not decision at the callsite, which is much more
straight-forward than dealing with lazy reflect-based evaluation.

Also, lazy evaluation would not work with 'native' slog, as in, these
two statements would be evaluated differently:

```golang
  log.Info("foo", "my lazy", lazyObj)
  slog.Info("foo", "my lazy", lazyObj)
```
2024-11-15 10:02:42 +08:00
Daniel Liu
ec4ca1ed6a all: replace log15 with slog (#28187) 2024-11-15 10:02:42 +08:00
Daniel Liu
41c4c9ba88 log: avoid stack lookups when not needed/used (#28069) 2024-11-15 10:02:42 +08:00
Daniel Liu
5eca853e52 log: improve documentation (#26753)
Add usage examples
2024-11-15 10:02:42 +08:00
Daniel Liu
49e889eb7c log: logging feature (#17097) 2024-11-15 10:02:41 +08:00
Daniel Liu
f391463457 log: fixes for golint warnings (#16775) 2024-11-15 10:02:41 +08:00
Daniel Liu
a79411fa06 all: fix staticcheck warning ST1005: incorrectly formatted error string 2024-10-24 09:48:20 +08:00
olumuyiwadad
571c41f891 FIx Bad block error. 2021-09-17 17:59:06 +05:30
Kurkó Mihály
a9835c1816 cmd, dashboard, log: log collection and exploration (#17097)
* cmd, dashboard, internal, log, node: logging feature

* cmd, dashboard, internal, log: requested changes

* dashboard, vendor: gofmt, govendor, use vendored file watcher

* dashboard, log: gofmt -s -w, goimports

* dashboard, log: gosimple
2018-07-11 10:59:04 +03:00
Elad
1836366ac1 all: library changes for swarm-network-rewrite (#16898)
This commit adds all changes needed for the merge of swarm-network-rewrite.
The changes:

- build: increase linter timeout
- contracts/ens: export ensNode
- log: add Output method and enable fractional seconds in format
- metrics: relax test timeout
- p2p: reduced some log levels, updates to simulation packages
- rpc: increased maxClientSubscriptionBuffer to 20000
2018-06-14 11:21:17 +02:00
kiel barry
09d44247f7 log: fixes for golint warnings (#16775) 2018-05-22 10:28:43 +03:00
Felix Lange
38e273597c log: log full level names instead of mispelled "EROR", "DBUG" 2017-02-27 15:32:48 +01:00
Péter Szilágyi
b9d48b4a93
log: add support for trace level, exit on critical 2017-02-23 12:00:03 +02:00
Péter Szilágyi
ec7f81f4bc
log, vendor: vendor in log15 inline into our codebase 2017-02-23 12:00:02 +02:00