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 structured logging #191

Merged
merged 2 commits into from
Oct 10, 2023
Merged

Add structured logging #191

merged 2 commits into from
Oct 10, 2023

Conversation

nahsra
Copy link
Contributor

@nahsra nahsra commented Oct 10, 2023

Here's a snapshot of output. I do include a framework-specific timestamp field that I think we'll want to add eventually.

$ ./gradlew :core-codemods:run --args='--output /tmp/dvja.codetf --verbose --dry-run --project-name WebGoat --log-rmat json /tmp/dvja'

{"timestamp":"2023-10-10T12:46:10.113002-04:00","message":"","level":"DEBUG","project_name":"WebGoat","file":"Logs.java","line":23}
{"timestamp":"2023-10-10T12:46:10.121251-04:00","message":"[starting]","level":"DEBUG","project_name":"WebGoat","file":"Logs.java","line":24}
{"timestamp":"2023-10-10T12:46:10.122303-04:00","message":"codemodder: java/0.67.9-SNAPSHOT","level":"INFO","project_name":"WebGoat","file":"CLI.java","line":253}
{"timestamp":"2023-10-10T12:46:10.124168-04:00","message":"","level":"DEBUG","project_name":"WebGoat","file":"Logs.java","line":23}
{"timestamp":"2023-10-10T12:46:10.1243-04:00","message":"[setup]","level":"DEBUG","project_name":"WebGoat","file":"Logs.java","line":24}
{"timestamp":"2023-10-10T12:46:10.138269-04:00","message":"dry run temporary directory: /var/folders/3n/_gqxkk5j6bd07m75_2s100wm0000gn/T/codemodder-project3203299650741969179","level":"DEBUG","project_name":"WebGoat","file":"CLI.java","line":284}
{"timestamp":"2023-10-10T12:46:10.342354-04:00","message":"dry run copy finished: 204ms","level":"DEBUG","project_name":"WebGoat","file":"CLI.java","line":288}

... and again without project_name:

{"timestamp":"2023-10-10T12:49:22.432909-04:00","message":"","level":"DEBUG","file":"Logs.java","line":23}
{"timestamp":"2023-10-10T12:49:22.444855-04:00","message":"[starting]","level":"DEBUG","file":"Logs.java","line":24}
{"timestamp":"2023-10-10T12:49:22.447171-04:00","message":"codemodder: java/0.67.9-SNAPSHOT","level":"INFO","file":"CLI.java","line":250}
{"timestamp":"2023-10-10T12:49:22.448285-04:00","message":"","level":"DEBUG","file":"Logs.java","line":23}
{"timestamp":"2023-10-10T12:49:22.448625-04:00","message":"[setup]","level":"DEBUG","file":"Logs.java","line":24}

@nahsra nahsra requested a review from drdavella October 10, 2023 16:50
@nahsra nahsra merged commit 732aa1d into main Oct 10, 2023
4 checks passed
@nahsra nahsra deleted the add_structured_logging branch October 10, 2023 18:21
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