[Logging-commits] r91 - www

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Aug 4 11:05:22 CEST 2011


Author: mariotomo
Date: 2011-08-04 11:05:21 +0200 (Thu, 04 Aug 2011)
New Revision: 91

Modified:
   www/hierarchical_loggers.shtml
   www/logger_objects.shtml
Log:
and introducing the object oriented approach


Modified: www/hierarchical_loggers.shtml
===================================================================
--- www/hierarchical_loggers.shtml	2011-08-04 08:51:48 UTC (rev 90)
+++ www/hierarchical_loggers.shtml	2011-08-04 09:05:21 UTC (rev 91)
@@ -35,8 +35,8 @@
 <code>
 R> <user>logReset()</user><br/>
 R> <user>addHandler(writeToConsole, logger='libro.romanzo')</user><br/>
-R> <user>loginfo('Ma cos'è questo amore?', logger='libro.romanzo.campanile')</user><br/>
-2010-04-08 11:18:59 INFO:libro.romanzo.campanile:Ma cos'è questo amore?<br/>
+R> <user>loginfo('Ma cos\'&egrave; questo amore?', logger='libro.romanzo.campanile')</user><br/>
+2010-04-08 11:18:59 INFO:libro.romanzo.campanile:Ma cos'&egrave; questo amore?<br/>
 R> <user>loginfo('Se la luna mi porta fortuna', logger='libro.romanzo.campanile')</user><br/>
 2010-04-08 11:19:05 INFO:libro.romanzo.campanile:Se la luna mi porta fortuna<br/>
 R> <user>loginfo('Giovanotti, non esageriamo!', logger='libro.romanzo.campanile')</user><br/>

Modified: www/logger_objects.shtml
===================================================================
--- www/logger_objects.shtml	2011-08-04 08:51:48 UTC (rev 90)
+++ www/logger_objects.shtml	2011-08-04 09:05:21 UTC (rev 91)
@@ -27,3 +27,24 @@
 > 
 </code>
 
+<p>let me keep it compact, I'm just giving you the code that will
+produce the same logging as in the previous example.  do notice that
+you can mix invoking object methods with usage of the global
+functions.
+
+<code>
+R> <user>logReset()</user><br/>
+R> <user>getLogger('libro.romanzo')$addHandler(writeToConsole)</user><br/>
+R> <user>lrc <- getLogger('libro.romanzo.campanile')</user><br/>
+R> <user>lrc$info('Ma cos\'&egrave; questo amore?')</user><br/>
+2010-04-08 11:18:59 INFO:libro.romanzo.campanile:Ma cos'&egrave; questo amore?<br/>
+R> <user>lrc$info('Se la luna mi porta fortuna')</user><br/>
+2010-04-08 11:19:05 INFO:libro.romanzo.campanile:Se la luna mi porta fortuna<br/>
+R> <user>lrc$info('Giovanotti, non esageriamo!')</user><br/>
+2010-04-08 11:19:12 INFO:libro.romanzo.campanile:Giovanotti, non esageriamo!<br/>
+R> <user>loginfo('memories of a survivor', logger='libro.romanzo.lessing')</user><br/>
+2010-04-08 11:22:06 INFO:libro.romanzo.lessing:memories of a survivor<br/>
+R> <user>getLogger('libro')$warn('talking to a hierarchically upper logger')</user><br/>
+R> <user>logerror('talking to an unrelated logger', logger='rivista.cucina')</user><br/>
+R> 
+</code>



More information about the Logging-commits mailing list