[Logging-commits] r83 - in oo/pkg: . R inst/unitTest man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Aug 2 16:16:31 CEST 2011


Author: mariotomo
Date: 2011-08-02 16:16:30 +0200 (Tue, 02 Aug 2011)
New Revision: 83

Modified:
   oo/pkg/NAMESPACE
   oo/pkg/R/methods.R
   oo/pkg/inst/unitTest/runit.data.interaction.R
   oo/pkg/man/Logger.Rd
Log:


Modified: oo/pkg/NAMESPACE
===================================================================
--- oo/pkg/NAMESPACE	2011-07-21 08:29:32 UTC (rev 82)
+++ oo/pkg/NAMESPACE	2011-08-02 14:16:30 UTC (rev 83)
@@ -1,4 +1,3 @@
 # $Id: NAMESPACE 61 2011-02-11 11:34:43Z mariotomo $
-export(Logger,
-       getLogger
+export(Logger
        )

Modified: oo/pkg/R/methods.R
===================================================================
--- oo/pkg/R/methods.R	2011-07-21 08:29:32 UTC (rev 82)
+++ oo/pkg/R/methods.R	2011-08-02 14:16:30 UTC (rev 83)
@@ -43,6 +43,3 @@
                         info = function(...) { log(loglevels["INFO"], ...) },
                         warn = function(...) { log(loglevels["WARN"], ...) },
                         error = function(...) { log(loglevels["ERROR"], ...) }))
-
-getLogger <- function(name = "")
-  Logger$new(name=name)

Modified: oo/pkg/inst/unitTest/runit.data.interaction.R
===================================================================
--- oo/pkg/inst/unitTest/runit.data.interaction.R	2011-07-21 08:29:32 UTC (rev 82)
+++ oo/pkg/inst/unitTest/runit.data.interaction.R	2011-08-02 14:16:30 UTC (rev 83)
@@ -40,14 +40,14 @@
 # end of functions that must be tested first
 
 test.canGetRootLoggerWithoutName <- function() {
-  root1 <- getLogger('')
-  root2 <- getLogger()
+  root1 <- Logger$new('')
+  root2 <- Logger$new()
   checkEquals(root1, root2)
 }
 
 test.canSetLoggerLevelByNamedValue <- function() {
   basicConfig()
-  root <- getLogger('')
+  root <- Logger$new('')
   root$setLevel(logging:::loglevels['DEBUG'])
   expect <- logging:::loglevels['DEBUG']
   checkEquals(root$getLevel(), expect)
@@ -55,7 +55,7 @@
 
 test.canSetLoggerLevelByName <- function() {
   basicConfig()
-  root <- getLogger('')
+  root <- Logger$new('')
   root$setLevel('DEBUG')
   expect <- logging:::loglevels['DEBUG']
   checkEquals(root$getLevel(), expect)
@@ -73,7 +73,7 @@
 
 test.recordIsEmitted.rootToRoot <- function() {
   logReset()
-  log <- getLogger('test')
+  log <- Logger$new('test')
   log$addHandler(mockAction)
   logged <<- NULL
   log$debug('test')
@@ -84,8 +84,8 @@
 
 test.recordIsEmitted.tooDeep <- function() {
   logReset()
-  root <- getLogger('')
-  log2 <- getLogger('too.deep')
+  root <- Logger$new('')
+  log2 <- Logger$new('too.deep')
   log2$addHandler(mockAction)
   logged <<- NULL
   root$debug('test')
@@ -96,8 +96,8 @@
 
 test.recordIsEmitted.unrelated <- function() {
   logReset()
-  log1 <- getLogger('other.branch')
-  log2 <- getLogger('too.deep')
+  log1 <- Logger$new('other.branch')
+  log2 <- Logger$new('too.deep')
   log2$addHandler(mockAction)
   logged <<- NULL
   log1$debug('test')
@@ -108,8 +108,8 @@
 
 test.recordIsEmitted.deepToRoot <- function() {
   logReset()
-  root <- getLogger('')
-  log <- getLogger('other.branch')
+  root <- Logger$new('')
+  log <- Logger$new('other.branch')
   root$addHandler(mockAction)
   logged <<- NULL
   log$debug('test')
@@ -120,8 +120,8 @@
 
 test.recordIsEmitted.deepToRoot.DI.dropped <- function() {
   logReset()
-  root <- getLogger('')
-  log <- getLogger('other.branch')
+  root <- Logger$new('')
+  log <- Logger$new('other.branch')
   root$addHandler(mockAction, level='DEBUG')
   logged <<- NULL
   log$setLevel('INFO')
@@ -133,8 +133,8 @@
 
 test.recordIsEmitted.deepToRoot.DD.passed <- function() {
   logReset()
-  root <- getLogger('')
-  log <- getLogger('other.branch')
+  root <- Logger$new('')
+  log <- Logger$new('other.branch')
   root$addHandler(mockAction, level='DEBUG')
   logged <<- NULL
   log$setLevel('DEBUG')
@@ -147,7 +147,7 @@
 
 test.formattingRecord.lengthZero <- function() {
   logReset()
-  log <- getLogger('')
+  log <- Logger$new('')
   log$addHandler(mockAction, level='DEBUG', formatter=mockFormatter)
   logged <<- NULL
   log$info("test '%s'", numeric(0))
@@ -156,7 +156,7 @@
 
 test.formattingRecord.lengthOne <- function() {
   logReset()
-  log <- getLogger()
+  log <- Logger$new()
   log$addHandler(mockAction, level='DEBUG', formatter=mockFormatter)
   logged <<- NULL
   log$info("test '%s'", 12)
@@ -165,7 +165,7 @@
 
 test.formattingRecord.lengthMore <- function() {
   logReset()
-  log <- getLogger()
+  log <- Logger$new()
   addHandler(mockAction, level='DEBUG', formatter=mockFormatter)
   logged <<- NULL
   log$info("test '%s'", c(0, 1, 2))
@@ -174,7 +174,7 @@
 
 test.formattingRecord.moreArguments <- function() {
   logReset()
-  log <- getLogger()
+  log <- Logger$new()
   log$addHandler(mockAction, level='DEBUG', formatter=mockFormatter)
   logged <<- NULL
   log$info("%s: %d", 'name', 123)
@@ -186,7 +186,7 @@
 
 test.formattingRecord.moreArguments.lengthMore <- function() {
   logReset()
-  log <- getLogger()
+  log <- Logger$new()
   log$addHandler(mockAction, level='DEBUG', formatter=mockFormatter)
   logged <<- NULL
   log$info("%s '%s'", 'name', c(0, 1, 2))
@@ -195,7 +195,7 @@
 
 test.formattingRecord.strips.whitespace <- function() {
   logReset()
-  log <- getLogger()
+  log <- Logger$new()
   log$addHandler(mockAction, level='DEBUG', formatter=mockFormatter)
   logged <<- NULL
   log$info("a string with trailing whitespace \n")

Modified: oo/pkg/man/Logger.Rd
===================================================================
--- oo/pkg/man/Logger.Rd	2011-07-21 08:29:32 UTC (rev 82)
+++ oo/pkg/man/Logger.Rd	2011-08-02 14:16:30 UTC (rev 83)
@@ -3,7 +3,6 @@
 
 \name{Logger}
 \alias{Logger}
-\alias{getLogger}
 \alias{\S4method{new}{Logger}}
 \alias{\S4method{log}{Logger}}
 \alias{\S4method{setLevel}{Logger}}
@@ -24,7 +23,6 @@
 }
 \usage{
 \S4method{new}{Logger}(name)
-getLogger(name="")
 \S4method{log}{Logger}(...)
 \S4method{setLevel}{Logger}(newLevel)
 \S4method{getLevel}{Logger}()



More information about the Logging-commits mailing list