This repository was archived by the owner on Oct 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 166
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
show file trace only for: - severity above info, eg. warn, error, fatal - global verbosity above 4(core), eg. debug, detail, ridiculousness also: - ansi color highlights for warn, error, and fatal severities
solution: modify flags to quieter defaults
solution: --verbosity-trace-floor=<int> debug.verbosityTraceFloor(int)
solution: use glog
This is an arguable point. I might be dead wrong. In which case we could just use |
Closing. Have taken lessons learned here and expanded on them in forthcoming PR from (a very messy) https://github.com/whilei/go-ethereum/tree/feat/log-display-separation |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
problem
Normal logging is kind of "noisy," as @splix complains in #410. With that in mind, making logs "pretty" also removes important debugging information.
solution
Makes pretty logs when a single flag
--pretty
is used. The reason I used opt-in prettiness in 199652e is because I believe geth should use defaults that are most useful for developers. While indeed it's important for beginners and laymen to have access to an approachable interface, I t hink we'd be shooting ourselves in the foot (it's hard enough getting issue contributors to include any logs) and moving away from a "technology first" principle by establishing a default prioritizing the 💄 before the 🔧 .With that said, there's very little I love more than a good interface. There's still a long way to go IMO with formatting the STATUS logs, adding possible other STATUS logs besides
SYNC
, and improving the design of the non-textual visual interface (eg. domino effect); but this is a start.note here that I'm overriding
--log-status
interval manually; the default for --pretty issync=15 [seconds]
solve specs
verbosity=error
lines are showngeth
still logs normal configuration stuff on startupdebug.verbosity(5)
is used to set verbosity on the fly (like if user is experiencing some weirdness or just wants a closer look for whatever reason) OR ifdebug.verbosityTraceFloor(1)
is used to set the minimum global verbosity threshold determining if file traces should be includedAll of these defaults can be overridden manually with their respective flags.
Further, in case of
severity=error
orseverity=fatal
, the calling file trace will always be shown.As explained in
geth help
:how it works
As-is, there are two "dimensions" of logging:
verbosity
andseverity
.The domino effect uses the number of dominos to represent the number of blocks imported since last log, and the domino dot-number to represent number of transactions per block (eg 🁣 = 0 txs, 🂓 = 12+ txs). Representing blocks imported and txs are currently simply 1:1 with actual blocks/txs, but eventually should be scaled dynamically (with a log function... get it?) based on maximums and the limits of reasonable display units, eg. show no more than 20 dominoes, and if tx count increases a lot lately, use domino 3-dots to represent 9 txs or whatever
changes
--verbosity-trace-floor
and JSON-API:debug.verbosityTraceFloor
to set the minimum global verbosity level at which to include file name traces in log line headers, eg.vs.
glog.formatHeader
to use verbosity and severity thresholds for including file traces in the headers--pretty
to toggle pretty default log settings, all of which can be overridden manually with their own flags.glog.Verbosity#Warn[|ln|f]
andglog.Verbosity#Error[|ln|f]
methods for using severity with verbosity in logging.>= severity.error
for including file traces. Important for debugging and reporting bugs.