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

sql: Confusing error reporting #35

Open
alexfikl opened this issue Sep 22, 2023 · 1 comment
Open

sql: Confusing error reporting #35

alexfikl opened this issue Sep 22, 2023 · 1 comment

Comments

@alexfikl
Copy link
Contributor

From #33

When not using the --log DEBUG option, if there is an error, you get, for each item, first a "negative" [ERROR] log entry than a "positive" [INFO] log entry.

This is also confusing. Makes mentally parsing the log difficult. At the beginning I wasnt even sure what > happened. I asked my self, what does this mean ? Did things went OK or not ? Was it a "sucess" or not ? Oh > ... , there is the word "ERROR" there, so things must have stopped, and nothing must have happened. But. It > did. Even with the error the items were "kind of imported".

This is confusing.

Were talking about importing data here.
It doesnt matter what the end result is.
Either succes or failure. Or something in between.

The important thing is that the end user should be 100% sure of what happened.
Be 100% sure of what is the current state of the data is on the system.

Assuming he has backups.
He should decide and the be able to rollback, delete everything, start over again.

I would expect something like this sequence of log entries

[INFO] Trying to export item XYZ (a nice  first neutral message)
[INFO] Sucessfully exported  item XYZ to folder foo/bar
[MAYBE] Some empty line here ? visually nice to separate
[INFO] Trying to export item ABC (a nice first neutral message)
[INFO] Sucessfully exported  item ABC to folder foo/bar

or in case something "bad" happens

[INFO] Trying to export item XYZ (a nice first neutral message)
[ERROR] Something bad happened .... bla bla bla ...
[INFO] Item XYZ exported to folder foo/bar with possible errors ... check blablabla ... some fields might be "wrong"
[MAYBE] Some empty line here ? visually nice to separate
[INFO] Trying to export item ABC (a nice first neutral message)
@m040601
Copy link

m040601 commented Oct 1, 2023

Also good and commonly used in log "machinery" , is the word "WARNING"

So better than,

[INFO] Trying to export item XYZ (a nice first neutral message)
[ERROR] Something bad happened .... bla bla bla ...
[INFO] Item XYZ exported to folder foo/bar with possible errors ... check blablabla ... 

Would instead be,

[INFO] Trying to export item XYZ (a nice first neutral message)
[ERROR] Something bad happened .... bla bla bla ...
[WARNING] Item XYZ exported to folder foo/bar ... but ... missing this/that ...with possible errors ... check blablabla ... 

More of the top of my mind,

critical
error
warning
info
debug
vdebug (as is verbose or very detailed debug)

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