You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by Andrus Adamchik <an...@objectstyle.org> on 2010/08/02 11:59:48 UTC

Re: [jira] Commented: (CAY-1464) Improve QueryLogger to log more information

On Aug 2, 2010, at 12:30 PM, Evgeny Ryabitskiy wrote:

> * Looks like you patch will log all fetched objects? If this is the
> * case, it is definitely a bad idea. There can be *lots* of them.
>
> Yes... I would suggest to separate this into several levels INFO and
> DEBUG, DEBUG is for logging fetched objects.
> If it's not applicable we could move it in another Logger  
> implementation.

Yes please, let's make it a separate logger.


> * What is the benefit of passing start time instead of time delta in
> * the logger? IMO the "old" API was cleaner, separating time  
> measurement
> * from logging.
>
> Benefit is that we shouldn't do startTime - endTime if Logging is
> disabled. -2 Operations (getCurrTime for endTime and operator "-"), so
> low CPU is used.
> I know it's minor optimization... but still... :) Unfortunately API
> become little bit less clear.

Yep. In a case of negligible performance optimization vs. clean API I  
always vote for the later. That's what ORM is about :-)


> * BTW, my other idea about was that we can define a very simple logger
> API, while "advanced" loggers would take extra
> * information about the current operation from the injectable
> environment objects (or maybe from thread-bound Transaction).
>
> Maybe you are right and I could resolve Connection from thread-bound
> Transaction.. but it's to much binded on this Transaction object...

What do you mean "too much"?

Andrus