-
Notifications
You must be signed in to change notification settings - Fork 224
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
Better error logging #159
Comments
Hi @vuhrmeister, while I agree the logging is not great, I don't think we will change this until the next major. When we do that, I plan on having a whole lot more robust solution for logging. In the mean time, why not log an error instance? That way your error message would be logged properly. |
Well, I can do that. It's just that the api I'm using is only returning an Object as error So I would always need to wrap it. Not the prettiest code then. |
btw: just wrapping an object with an |
Hey, I mean an object is not an error. I am not sure this lib can solve this problem for you, and even my future logging efforts will require it to be a real |
I'm writing my own store class. Inside
save
orload
on exceptions I callfn(error)
. But iferror
is a plain Object then only this is being logged.error : [object Object]
The problem is, that the error is logged as a string: https://github.com/tj/node-migrate/blob/master/lib/log.js#L9
I would rather change it to something like this, thus making it more general:
The text was updated successfully, but these errors were encountered: