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

Is there a verbose execution mode? #1

Closed
lestephane opened this issue Feb 28, 2019 · 8 comments
Closed

Is there a verbose execution mode? #1

lestephane opened this issue Feb 28, 2019 · 8 comments

Comments

@lestephane
Copy link

I'd like to see some output when running hledger-makeitso import

Background: hledger-makeitso import repeatedly failed for me when I tried makeitso for the first time today. I eventually figured that I called my preprocess script preprocessor instead of preprocess

@apauley
Copy link
Owner

apauley commented Mar 1, 2019

Hi @lestephane, yes, it is definitely needed, I'll work on this when I get some time.
No promises exactly when (I'm away for the weekend), but it should be easy to do.

Thinking aloud here: perhaps a single -v to hledger-makeitso import would make it print some basic information, with more than one v added would cause it to print more information, and pass along the verbose flags to custom scripts like preprocess.

I'll see what the command-line options library allow here.

apauley added a commit that referenced this issue Mar 1, 2019
@apauley
Copy link
Owner

apauley commented Mar 1, 2019

@lestephane I've started a branch and a pull request to work on this:
#2

Currently the import subcommand will accept a verbose flag on that branch, but it doesn't use the flag just yet.
More commits on this PR should address that.

@apauley
Copy link
Owner

apauley commented Mar 3, 2019

Hi @lestephane, I've added some verbose output on the ISSUE-1-verbose-output branch.

Could you try it out?

This is an example of what you might see:

$ hledger-makeitso import --verbose
2019-03-03 22:52:41.510390024 SAST	hledger-makeitso: Collecting input files...
2019-03-03 22:52:41.664377916 SAST	hledger-makeitso: Found 3 input files
2019-03-03 22:52:41.664611207 SAST	hledger-makeitso: Found a preprocess file at hledger-makeitso-example-finances/import/gawie/bogart/cheque/preprocess
2019-03-03 22:52:41.688166122 SAST	hledger-makeitso: Finished executing hledger-makeitso-example-finances/import/gawie/bogart/cheque/preprocess
2019-03-03 22:52:41.688724062 SAST	hledger-makeitso: Did not find a construct file at hledger-makeitso-example-finances/import/gawie/bogart/cheque/construct
2019-03-03 22:52:41.689199073 SAST	hledger-makeitso: Starting import of hledger-makeitso-example-finances/import/gawie/bogart/cheque/2-preprocessed/2016/123456789_2016-04-28.csv using rules file at hledger-makeitso-example-finances/import/gawie/bogart/cheque/bogart-cheque.rules
2019-03-03 22:52:41.851953474 SAST	hledger-makeitso: Finished importing hledger-makeitso-example-finances/import/gawie/bogart/cheque/2-preprocessed/2016/123456789_2016-04-28.csv using rules file at hledger-makeitso-example-finances/import/gawie/bogart/cheque/bogart-cheque.rules
2019-03-03 22:52:41.852803905 SAST	hledger-makeitso: Found a preprocess file at hledger-makeitso-example-finances/import/gawie/bogart/cheque/preprocess
2019-03-03 22:52:41.87625886 SAST	hledger-makeitso: Finished executing hledger-makeitso-example-finances/import/gawie/bogart/cheque/preprocess
2019-03-03 22:52:41.876770231 SAST	hledger-makeitso: Did not find a construct file at hledger-makeitso-example-finances/import/gawie/bogart/cheque/construct
2019-03-03 22:52:41.880150044 SAST	hledger-makeitso: Starting import of hledger-makeitso-example-finances/import/gawie/bogart/cheque/2-preprocessed/2016/123456789_2016-05-28.csv using rules file at hledger-makeitso-example-finances/import/gawie/bogart/cheque/bogart-cheque.rules
2019-03-03 22:52:42.041891675 SAST	hledger-makeitso: Finished importing hledger-makeitso-example-finances/import/gawie/bogart/cheque/2-preprocessed/2016/123456789_2016-05-28.csv using rules file at hledger-makeitso-example-finances/import/gawie/bogart/cheque/bogart-cheque.rules
2019-03-03 22:52:42.042725295 SAST	hledger-makeitso: Found a preprocess file at hledger-makeitso-example-finances/import/gawie/bogart/cheque/preprocess
2019-03-03 22:52:42.065642929 SAST	hledger-makeitso: Finished executing hledger-makeitso-example-finances/import/gawie/bogart/cheque/preprocess
2019-03-03 22:52:42.06612022 SAST	hledger-makeitso: Did not find a construct file at hledger-makeitso-example-finances/import/gawie/bogart/cheque/construct
2019-03-03 22:52:42.06656573 SAST	hledger-makeitso: Starting import of hledger-makeitso-example-finances/import/gawie/bogart/cheque/2-preprocessed/2016/123456789_2016-03-30.csv using rules file at hledger-makeitso-example-finances/import/gawie/bogart/cheque/bogart-cheque.rules
2019-03-03 22:52:42.228158811 SAST	hledger-makeitso: Finished importing hledger-makeitso-example-finances/import/gawie/bogart/cheque/2-preprocessed/2016/123456789_2016-03-30.csv using rules file at hledger-makeitso-example-finances/import/gawie/bogart/cheque/bogart-cheque.rules

@apauley
Copy link
Owner

apauley commented Mar 4, 2019

I changed the output to include the execution times of the custom scripts and a few other tweaks:

$ hledger-makeitso import -v
2019-03-04 22:48:50.519642439 SAST	hledger-makeitso Collecting input files...
2019-03-04 22:48:50.697360986 SAST	hledger-makeitso Found 3 input files
2019-03-04 22:48:50.697638997 SAST	hledger-makeitso Found a preprocess file at 'import/gawie/bogart/cheque/preprocess'
2019-03-04 22:48:50.698029777 SAST	hledger-makeitso Begin: executing 'import/gawie/bogart/cheque/preprocess' on 'import/gawie/bogart/cheque/1-in/2016/123456789_2016-04-28.csv'
2019-03-04 22:48:50.720766651 SAST	hledger-makeitso End:   executing 'import/gawie/bogart/cheque/preprocess' on 'import/gawie/bogart/cheque/1-in/2016/123456789_2016-04-28.csv' (0.022230173s)
2019-03-04 22:48:50.721555152 SAST	hledger-makeitso Did not find a construct file at 'import/gawie/bogart/cheque/construct'
2019-03-04 22:48:50.722799403 SAST	hledger-makeitso Begin: importing 'import/gawie/bogart/cheque/2-preprocessed/2016/123456789_2016-04-28.csv' using rules file 'import/gawie/bogart/cheque/bogart-cheque.rules'
2019-03-04 22:48:50.886823326 SAST	hledger-makeitso End:   importing 'import/gawie/bogart/cheque/2-preprocessed/2016/123456789_2016-04-28.csv' using rules file 'import/gawie/bogart/cheque/bogart-cheque.rules' (0.163296212s)
2019-03-04 22:48:50.887605317 SAST	hledger-makeitso Found a preprocess file at 'import/gawie/bogart/cheque/preprocess'
2019-03-04 22:48:50.887976737 SAST	hledger-makeitso Begin: executing 'import/gawie/bogart/cheque/preprocess' on 'import/gawie/bogart/cheque/1-in/2016/123456789_2016-05-28.csv'
2019-03-04 22:48:50.922670644 SAST	hledger-makeitso End:   executing 'import/gawie/bogart/cheque/preprocess' on 'import/gawie/bogart/cheque/1-in/2016/123456789_2016-05-28.csv' (0.034184796s)
2019-03-04 22:48:50.923391585 SAST	hledger-makeitso Did not find a construct file at 'import/gawie/bogart/cheque/construct'
2019-03-04 22:48:50.923867345 SAST	hledger-makeitso Begin: importing 'import/gawie/bogart/cheque/2-preprocessed/2016/123456789_2016-05-28.csv' using rules file 'import/gawie/bogart/cheque/bogart-cheque.rules'
2019-03-04 22:48:51.084951075 SAST	hledger-makeitso End:   importing 'import/gawie/bogart/cheque/2-preprocessed/2016/123456789_2016-05-28.csv' using rules file 'import/gawie/bogart/cheque/bogart-cheque.rules' (0.160474009s)
2019-03-04 22:48:51.085645726 SAST	hledger-makeitso Found a preprocess file at 'import/gawie/bogart/cheque/preprocess'
2019-03-04 22:48:51.086249207 SAST	hledger-makeitso Begin: executing 'import/gawie/bogart/cheque/preprocess' on 'import/gawie/bogart/cheque/1-in/2016/123456789_2016-03-30.csv'
2019-03-04 22:48:51.109296881 SAST	hledger-makeitso End:   executing 'import/gawie/bogart/cheque/preprocess' on 'import/gawie/bogart/cheque/1-in/2016/123456789_2016-03-30.csv' (0.022477384s)
2019-03-04 22:48:51.109882621 SAST	hledger-makeitso Did not find a construct file at 'import/gawie/bogart/cheque/construct'
2019-03-04 22:48:51.110270852 SAST	hledger-makeitso Begin: importing 'import/gawie/bogart/cheque/2-preprocessed/2016/123456789_2016-03-30.csv' using rules file 'import/gawie/bogart/cheque/bogart-cheque.rules'
2019-03-04 22:48:51.272289433 SAST	hledger-makeitso End:   importing 'import/gawie/bogart/cheque/2-preprocessed/2016/123456789_2016-03-30.csv' using rules file 'import/gawie/bogart/cheque/bogart-cheque.rules' (0.161423111s)

@apauley
Copy link
Owner

apauley commented Mar 4, 2019

Optional verbose mode is now in master, after #2 has been merged

@apauley apauley closed this as completed Mar 4, 2019
@lestephane
Copy link
Author

lestephane commented Mar 15, 2019 via email

@apauley
Copy link
Owner

apauley commented Mar 15, 2019

@lestephane There has been another merge that might affect you if you already got to a point where you created an opening journal. The file needs to move one level up now.

The PR description has more details: #3

@lestephane
Copy link
Author

lestephane commented Mar 19, 2019 via email

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

No branches or pull requests

2 participants