Closed vinurs closed 2 years ago
Hi @vinurs,
I'm not familiar with libpython
but from your linked issue it looks like the Python type you're trying to log doesn't implement hashing.
As an optimization, Timbre uses internal caching that depends on its arguments being hashed.
What are your appenders doing with the Python object?
If you're just printing them (or otherwise coercing them to strings) - one trivial workaround would be to just call str
on such Python types when logging.
Timbre intentionally avoids auto-coercing its arguments to strings, since auto-coercing would prevent appenders and middleware from handling raw arguments which can be really handy.
@ptaoussanis this is my appender
(timbre/merge-config!
{:timestamp-opts {:pattern "yyyy-MM-dd HH:mm:ss zz",
:locale :jvm-default
:timezone :jvm-default}
:appenders {:spit (rolling/rolling-appender
{:path "log/trace-rolling.log"
:pattern :daily})}})
thanks for ur suggestion, i just want to log the python object for debug to see its content, so with str
is a good idea
thanks for ur suggestion, i just want to log the python object for debug to see its content, so with str is a good idea
Great, that should work well then 👍
hello, i want to use timbre to log python object with libpython-clj, but it can not log https://github.com/clj-python/libpython-clj/issues/205