Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new flag -log-format and a simple format #517

Merged
merged 1 commit into from
Apr 25, 2022

Conversation

roman-kruglov
Copy link
Contributor

the most human readable format for those who only look at the output in a terminal

Description

With the recent switch to zap as the used logger it became much harder to just look at terminal's output. If you just run it manually and the output is for reading rather than logging, using -log-format simple makes the output much more bearable.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

By running and looking at the output in a terminal.

Test Configuration

  • Release version: latest main branch (v0.8.30 is the latest current release)
  • Platform: Mac OS

Logs

Output sample (real values crossed out)

db1000n % ./db1000n -log-format simple
running db1000n {"version": "v0.8.30", "pid": 84370}
checking IP address,    {"iter": 1}
error fetching location info    {"error": "Get \"https://sample/\": context deadline exceeded"}
checking IP address,    {"iter": 2}
location info   {"country": "Some country", "ip": "XX.XX.XX.XX"}
loading config  {"path": "sample"}
new config received, applying
attacking       {"target": "http://sample"}
attacking       {"target": "http://sample"}
attacking       {"target": "http://sample"}
error running job       {"name": "", "type": "encrypted", "error": "encryption not supported"}
job instances (re)started       {"count": 874}
attacking       {"target": "https://sample/sample"}
single http request     {"target": "https://sample/"}

the most human readable format for those who only look at the output in a terminal
Copy link
Owner

@arriven arriven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would maybe even go ahead and make it the default format in next release

@roman-kruglov
Copy link
Contributor Author

I would maybe even go ahead and make it the default format in next release

yeah, exactly, I was thinking the same thing, but thought it would be too much to ask for this with my first pr :) I'll make it happen, have several more ideas how to improve it even more

@roman-kruglov roman-kruglov deleted the simple-terminal-output branch April 25, 2022 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants