Closed jwoertink closed 4 years ago
My gut feeling here is that we should figure out why Lucky.logger.info(UserQuery.first)
doesn't work because I think it should print something or fail to compile (like you mentioned). My thought is that it should just work by calling inspect
or whatever pp
does under the hood
This is no longer an issue in 0.2.0. It will fail if not returning a Hash or NamedTuple, and if you use the built-in Log
it will call to_s
on it. Probably best to add a better inspect to models too but I'll close this one for now since the logger side is done
Also we can add a request id in 0.2.0. Working on that this weekend!
If you have a model instance, and you want to log that, right now you might use
pp
. If you try and pass this toLucky.logger.info
, you'll find that nothing happens. No compile error, no output.I'm thinking maybe the first way throws a compile-time error, and then we add a special method like
inspect
or whatever to models.Side related: https://github.com/luckyframework/lucky/issues/950