From noreply at r-forge.r-project.org Mon Apr 8 11:57:39 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 8 Apr 2013 11:57:39 +0200 (CEST) Subject: [Logging-commits] r103 - handlers/pkg pkg pkg/R pkg/inst/unitTest pkg/man Message-ID: <20130408095739.2EB22183B2A@r-forge.r-project.org> Author: mariotomo Date: 2013-04-08 11:57:38 +0200 (Mon, 08 Apr 2013) New Revision: 103 Modified: handlers/pkg/DESCRIPTION pkg/DESCRIPTION pkg/R/logger.R pkg/inst/unitTest/runit.data.interaction.R pkg/inst/unitTest/runit.handlers.R pkg/man/logging-package.Rd Log: synchronizing with the github version. Modified: handlers/pkg/DESCRIPTION =================================================================== --- handlers/pkg/DESCRIPTION 2012-04-19 11:28:35 UTC (rev 102) +++ handlers/pkg/DESCRIPTION 2013-04-08 09:57:38 UTC (rev 103) @@ -1,6 +1,6 @@ Package: logging.handlers -Version: 0.7-102 -Date: 2011-04-27 +Version: 0.7-103 +Date: 2013-04-08 Title: extra logging handlers Author: Mario Frasca Maintainer: Mario Frasca Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2012-04-19 11:28:35 UTC (rev 102) +++ pkg/DESCRIPTION 2013-04-08 09:57:38 UTC (rev 103) @@ -1,10 +1,10 @@ Package: logging -Version: 0.7-102 -Date: 2010-06-17 +Version: 0.7-103 +Date: 2013-04-08 Title: R logging package Author: Mario Frasca Maintainer: Mario Frasca Description: logging is a pure R package that implements the ubiquitous log4j package. License: GPL (>=2) Depends: R (>= 2.12.0), methods -Suggests: svUnit +Suggests: svUnit, XML Modified: pkg/R/logger.R =================================================================== --- pkg/R/logger.R 2012-04-19 11:28:35 UTC (rev 102) +++ pkg/R/logger.R 2013-04-08 09:57:38 UTC (rev 103) @@ -104,7 +104,7 @@ basicConfig <- function(level=20) { rootLogger <- getLogger() updateOptions(rootLogger, level=namedLevel(level)) - rootLogger$addHandler('basic.stdout', writeToConsole) + rootLogger$addHandler('basic.stdout', writeToConsole, level=namedLevel(level)) invisible() } Modified: pkg/inst/unitTest/runit.data.interaction.R =================================================================== --- pkg/inst/unitTest/runit.data.interaction.R 2012-04-19 11:28:35 UTC (rev 102) +++ pkg/inst/unitTest/runit.data.interaction.R 2013-04-08 09:57:38 UTC (rev 103) @@ -35,6 +35,22 @@ checkIdentical(rootLogger1, rootLogger2) } +test.500.basicConfigSetsLevelOfHandler <- function() { + logReset() + basicConfig('DEBUG') + rootLogger <- getLogger('') + expect <- logging:::loglevels['DEBUG'] + current <- rootLogger$getHandler('basic.stdout')[['level']] + checkEquals(current, expect) + logReset() + basicConfig('ERROR') + rootLogger <- getLogger('') ## needed, because `logReset` unlinked the old one + expect <- logging:::loglevels['ERROR'] + current <- rootLogger$getHandler('basic.stdout')[['level']] + checkEquals(current, expect) + logReset() +} + # end of functions that must be tested first test.canFindLoggingLevels <- function() { @@ -124,7 +140,7 @@ logReset() addHandler(mockAction, level='DEBUG', logger='') logged <<- NULL - setLevel('other.branch', 'INFO') + setLevel('INFO', 'other.branch') logdebug('test', logger='other.branch') loginfo('test', logger='other.branch') logerror('test', logger='other.branch') Modified: pkg/inst/unitTest/runit.handlers.R =================================================================== --- pkg/inst/unitTest/runit.handlers.R 2012-04-19 11:28:35 UTC (rev 102) +++ pkg/inst/unitTest/runit.handlers.R 2013-04-08 09:57:38 UTC (rev 103) @@ -46,7 +46,7 @@ file.remove(test.fileName) getLogger()$setLevel('FINEST') - addHandler(writeToFile, file=test.fileName, level='DEBUG') + addHandler(writeToFile, file=test.fileName[[1]], level='DEBUG') checkEquals(c("writeToFile"), with(getLogger(), names(handlers))) loginfo('test %d', 1) logdebug('test %d', 2) @@ -60,7 +60,7 @@ log <- getLogger() log$setLevel('FINEST') - log$addHandler(writeToFile, file=test.fileName, level='DEBUG') + log$addHandler(writeToFile, file=test.fileName[[1]], level='DEBUG') checkEquals(c("writeToFile"), with(log, names(handlers))) log$info('test %d', 1) log$debug('test %d', 2) Modified: pkg/man/logging-package.Rd =================================================================== --- pkg/man/logging-package.Rd 2012-04-19 11:28:35 UTC (rev 102) +++ pkg/man/logging-package.Rd 2013-04-08 09:57:38 UTC (rev 103) @@ -21,7 +21,7 @@ This package owes a lot to my employer, r-forge, the stackoverflow community, Brian Lee Yung Rowe's - \code{\link[futile:futile-package]{futile}} package (v1.1) and the + futile package (v1.1) and the documentation of the Python logging package. } @@ -75,7 +75,3 @@ this package at r-forge: \url{http://logging.r-forge.r-project.org/} } \keyword{ package } - -\seealso{ - \code{\link[futile:futile-package]{http://cran.r-project.org/web/packages/futile/index.html}} -}