You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by fe...@apache.org on 2007/03/29 08:30:33 UTC

svn commit: r523580 - /cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/caching/impl/CacheImpl.java

Author: felixk
Date: Wed Mar 28 23:30:32 2007
New Revision: 523580

URL: http://svn.apache.org/viewvc?view=rev&rev=523580
Log:
Make method getLogger() visible for extending classes like
blocks/cocoon-scratchpad/cocoon-scratchpad-impl/src/main/java/org/apache/cocoon/caching/SimpleCache.java

Modified:
    cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/caching/impl/CacheImpl.java

Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/caching/impl/CacheImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/caching/impl/CacheImpl.java?view=diff&rev=523580&r1=523579&r2=523580
==============================================================================
--- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/caching/impl/CacheImpl.java (original)
+++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/caching/impl/CacheImpl.java Wed Mar 28 23:30:32 2007
@@ -114,7 +114,7 @@
         this.store = store;
     }
     
-    private Log getLogger() {
+    protected Log getLogger() {
         return this.logger;
     }    
 



Re: svn commit: r523580 - /cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/caching/impl/CacheImpl.java

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Reinhard Poetz wrote:
> Vadim Gritsenko wrote:
>> felixk@apache.org wrote:
>>> Make method getLogger() visible for extending 
>>
>>> -    private Log getLogger() {
>>> +    protected Log getLogger() {
>>
>> Felix,
>>
>> As far as commons logging usage pattern goes, extending classes should 
>> create own instances of the log, otherwise log will get really 
>> confusing, with class name of one class and message from another class.
> 
> if the getClass() method is used, then extending classes should be safe. 
> It's only problematic when static logging is used, then you're right, 
> that you would log into the category of the parent object.

Yep, thanks for correction, I was still assuming static logger :)

Vadim

Re: svn commit: r523580 - /cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/caching/impl/CacheImpl.java

Posted by Reinhard Poetz <re...@apache.org>.
Vadim Gritsenko wrote:
> felixk@apache.org wrote:
>> Make method getLogger() visible for extending 
> 
>> -    private Log getLogger() {
>> +    protected Log getLogger() {
> 
> Felix,
> 
> As far as commons logging usage pattern goes, extending classes should 
> create own instances of the log, otherwise log will get really 
> confusing, with class name of one class and message from another class.

if the getClass() method is used, then extending classes should be safe. It's 
only problematic when static logging is used, then you're right, that you would 
log into the category of the parent object.

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

Re: svn commit: r523580 - /cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/caching/impl/CacheImpl.java

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Felix Knecht wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Vadim Gritsenko schrieb:
>> felixk@apache.org wrote:
>>> Make method getLogger() visible for extending
>>> -    private Log getLogger() { +    protected Log getLogger() {
>> Felix,
>>
>> As far as commons logging usage pattern goes, extending classes
>> should create own instances of the log, otherwise log will get
>> really confusing, with class name of one class and message from
>> another class.
> 
> I see. But in this case we also can avoid the private method
> 'getLogger()' and use the defined class logger directly without going
> the long way round getLogger() ?

I think reason getLogger() was added simply to avoid many small changes to the file.

Vadim

Re: svn commit: r523580 - /cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/caching/impl/CacheImpl.java

Posted by Felix Knecht <fe...@otego.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vadim Gritsenko schrieb:
> felixk@apache.org wrote:
>> Make method getLogger() visible for extending
>
>> -    private Log getLogger() { +    protected Log getLogger() {
>
> Felix,
>
> As far as commons logging usage pattern goes, extending classes
> should create own instances of the log, otherwise log will get
> really confusing, with class name of one class and message from
> another class.

I see. But in this case we also can avoid the private method
'getLogger()' and use the defined class logger directly without going
the long way round getLogger() ?

Felix
>
> Vadim
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGC7Au2lZVCB08qHERAg7uAJ91PlNkdvStwzTN17pm2p9ztMk6twCgpjzl
vMFTmpE+iQXdhrreK/BZ4ZI=
=yy1O
-----END PGP SIGNATURE-----


Re: svn commit: r523580 - /cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/caching/impl/CacheImpl.java

Posted by Vadim Gritsenko <va...@reverycodes.com>.
felixk@apache.org wrote:
> Make method getLogger() visible for extending 

> -    private Log getLogger() {
> +    protected Log getLogger() {

Felix,

As far as commons logging usage pattern goes, extending classes should create 
own instances of the log, otherwise log will get really confusing, with class 
name of one class and message from another class.

Vadim