GenericEnumMapper is a bit too chatty on the logs for me #563
-
Hi and thanks for the awesome lib! One issue I have is GenericEnumMapper<> (or related code) is that it is emitting quite a lot of debug messages when it performs conversions string -> enum (and presumably back). This makes reading system logs a bit cumbersome. For example (with assembly, enum and table names replaced to protect the innocent):
The mapping is Map(x => x.EnumProp, "enum_column").Nullable().Length(64).CustomType<GenericEnumMapper<MyEnum>>(); Maybe the mapping is not how it should look for mapping an enum value to string on DB? However I could not find the code that does this in the repo that does this logging with simple greps. Maybe it is in some dependency or NHibernate itself? If you could point me to the place I could make a PR then. Is there a way to tune down the volume of the log messages? I guess one way would be to configure logging system to match on GenericEnumMapper, but maybe it would be good for the default behaviour to be a little bit more quiet? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, it is in NHibernate. The code is here:
Yes, you should be able to disable debug logging for this logger. Use PS: you should not use debug logging in production. |
Beta Was this translation helpful? Give feedback.
Yes, it is in NHibernate. The code is here:
"returning null as column"
: https://github.com/nhibernate/nhibernate-core/blob/47992e73ed6114093f31ed99829dd8c4c7663829/src/NHibernate/Type/NullableType.cs#L222-L225"binding 'EnumValue' to parameter"
: https://github.com/nhibernate/nhibernate-core/blob/47992e73ed6114093f31ed99829dd8c4c7663829/src/NHibernate/Type/NullableType.cs#L157-L160"returning 'EnumValue' as column"
https://github.com/nhibernate/nhibernate-core/blob/47992e73ed6114093f31ed99829dd8c4c7663829/src/NHibernate/Type/Nullable…