-
Notifications
You must be signed in to change notification settings - Fork 258
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
Log formats and general improvements #47
Conversation
cloud_enum.py
Outdated
parser.add_argument('-f', '--format', type=str, action='store', default='json', | ||
help='Format for log file (json or csv, defaults to json)') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid breaking changes (unless you don't mind), maybe it's worth making this default to None
and if that's the case then save the output in the current, existing format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, good point. I'm not so concerned about breaking what was already a hard to parse log file. But perhaps it's worth adding a "text" option as the default that logs it as plain text, without the ansi stuff. Some might be more familiar with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
This PR will try to help those working with tooling output programmatically.
It gets rid of the old
printc
function and replaces it withfmt_output
. This consumes findings as python dictionaries, giving us flexibility in how we deal with the data.It behaves the same in terms of printing to the screen. However, when a log file is specified it can write the individual items to it either in CSV or JSON.
Still to do:
Ideas from: #46
UPDATE:
I'm taking the time to address some other things in this PR, too: