[Logging-commits] r40 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 16 13:41:33 CEST 2010


Author: mariotomo
Date: 2010-06-16 13:41:33 +0200 (Wed, 16 Jun 2010)
New Revision: 40

Modified:
   pkg/R/logger.R
Log:
internal ticket #1834: a user was using a logger that could be NULL and the library only tested against NA.


Modified: pkg/R/logger.R
===================================================================
--- pkg/R/logger.R	2010-04-14 13:47:47 UTC (rev 39)
+++ pkg/R/logger.R	2010-06-16 11:41:33 UTC (rev 40)
@@ -53,7 +53,7 @@
 ## (entry points for messages)
 levellog <- function(level, msg, ..., logger=NA, sourcelogger='')
 {
-  if (is.na(logger))
+  if (!is.character(logger))
     logger <- sourcelogger
   ## get the logger of which we have the name.
   config <- getLogger(logger)
@@ -83,7 +83,7 @@
 
   ## if not at root level, check the parent logger
   if(logger != ''){
-    parts <- strsplit(logger, '\\.')[[1]] # split the name on the '.'
+    parts <- strsplit(logger, '.', fixed=TRUE)[[1]] # split the name on the '.'
     removed <- parts[-length(parts)] # except the last item
     parent <- paste(removed, collapse='.')
     levellog(level, msg, ..., logger=parent, sourcelogger=sourcelogger)



More information about the Logging-commits mailing list