[Logging-commits] r11 - pkg pkg/R pkg/inst/RUnit pkg/man pkg/tests www

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Apr 3 20:54:24 CEST 2010


Author: mariotomo
Date: 2010-04-03 20:54:20 +0200 (Sat, 03 Apr 2010)
New Revision: 11

Modified:
   pkg/DESCRIPTION
   pkg/NAMESPACE
   pkg/R/logger.R
   pkg/cleanup
   pkg/inst/RUnit/runit.data.interaction.R
   pkg/man/addHandler.Rd
   pkg/man/basicConfig.Rd
   pkg/man/getLogger.Rd
   pkg/man/handler-actions.Rd
   pkg/man/levels.Rd
   pkg/man/log.Rd
   pkg/man/logging-internal.Rd
   pkg/man/logging-package.Rd
   pkg/man/removeHandler.Rd
   pkg/man/setLevel.Rd
   pkg/tests/doRUnit.R
   www/index.php
Log:
possibly correcting the REV problem

Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2010-04-01 08:39:13 UTC (rev 10)
+++ pkg/DESCRIPTION	2010-04-03 18:54:20 UTC (rev 11)
@@ -6,4 +6,4 @@
 Maintainer: Mario Frasca <mario.frasca at nelen-schuurmans.nl>
 Description: a logging package emulating the python logging package.
 License: GPL (>=2)
-Depends: R (>= 2.9.2)
\ No newline at end of file
+Depends: R (>= 2.9.2)


Property changes on: pkg/DESCRIPTION
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE	2010-04-01 08:39:13 UTC (rev 10)
+++ pkg/NAMESPACE	2010-04-03 18:54:20 UTC (rev 11)
@@ -1,12 +1,13 @@
-export(levels,
+# $Id$
+export(loglevels,
+       logfinest,
+       logfiner,
+       logfine,
+       logdebug,
+       loginfo,
+       logwarn,
+       logerror,
        levellog,
-       finest,
-       finer,
-       fine,
-       debug,
-       info,
-       warn,
-       error,
        basicConfig,
        getLogger,
        addHandler,


Property changes on: pkg/NAMESPACE
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: pkg/R/logger.R
===================================================================
--- pkg/R/logger.R	2010-04-01 08:39:13 UTC (rev 10)
+++ pkg/R/logger.R	2010-04-03 18:54:20 UTC (rev 11)
@@ -28,8 +28,8 @@
 ##
 
 ## TODO: these constants must be exported and documented
-levels <- c(0, 1, 4, 7, 10, 20, 30, 40, 50, 50)
-names(levels) <- c('NOTSET', 'FINEST', 'FINER', 'FINE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL', 'FATAL')
+loglevels <- c(0, 1, 4, 7, 10, 20, 30, 40, 50, 50)
+names(loglevels) <- c('NOTSET', 'FINEST', 'FINER', 'FINE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL', 'FATAL')
 
 ## main log function, used by all other ones
 ## (entry points for messages)
@@ -48,7 +48,7 @@
   record$timestamp <- sprintf("%s", Sys.time())
   record$logger <- logger
   record$level <- level
-  record$levelname <- names(which(levels == level)[1])
+  record$levelname <- names(which(loglevels == level)[1])
   if(is.na(record$levelname))
     record$levelname <- paste("NumericLevel(", level, ")", sep='')
 
@@ -71,48 +71,48 @@
 }
 
 ## using log
-debug <- function(msg, ..., logger='')
+logdebug <- function(msg, ..., logger='')
 {
-  levellog(levels['DEBUG'], msg, ..., logger=logger)
+  levellog(loglevels[['DEBUG']], msg, ..., logger=logger)
   invisible()
 }
 
-finest <- function(msg, ..., logger='')
+logfinest <- function(msg, ..., logger='')
 {
-  levellog(levels['FINEST'], msg, ..., logger=logger)
+  levellog(loglevels['FINEST'], msg, ..., logger=logger)
   invisible()
 }
 
-finer <- function(msg, ..., logger='')
+logfiner <- function(msg, ..., logger='')
 {
-  levellog(levels['FINER'], msg, ..., logger=logger)
+  levellog(loglevels['FINER'], msg, ..., logger=logger)
   invisible()
 }
 
-fine <- function(msg, ..., logger='')
+logfine <- function(msg, ..., logger='')
 {
-  levellog(levels['FINE'], msg, ..., logger=logger)
+  levellog(loglevels[['FINE']], msg, ..., logger=logger)
   invisible()
 }
 
 ## using log
-info <- function(msg, ..., logger='')
+loginfo <- function(msg, ..., logger='')
 {
-  levellog(levels['INFO'], msg, ..., logger=logger)
+  levellog(loglevels['INFO'], msg, ..., logger=logger)
   invisible()
 }
 
 ## using log
-warn <- function(msg, ..., logger='')
+logwarn <- function(msg, ..., logger='')
 {
-  levellog(levels['WARN'], msg, ..., logger=logger)
+  levellog(loglevels['WARN'], msg, ..., logger=logger)
   invisible()
 }
 
 ## using log
-error <- function(msg, ..., logger='')
+logerror <- function(msg, ..., logger='')
 {
-  levellog(levels['ERROR'], msg, ..., logger=logger)
+  levellog(loglevels['ERROR'], msg, ..., logger=logger)
   invisible()
 }
 
@@ -125,7 +125,7 @@
 
   config <- list(...)
   if (! 'level' %in% names(config))
-    config$level = levels['INFO']
+    config$level = loglevels['INFO']
 
   # is there a logger by this name already?
   if (! exists(name, logging.options))
@@ -153,8 +153,8 @@
 ## set the level of a handler or a logger
 setLevel <- function(name, level)
 {
-  if (level %in% names(levels))
-    level <- levels[level]
+  if (level %in% names(loglevels))
+    level <- loglevels[level]
   updateOptions(name, level=level)
 }
 
@@ -199,7 +199,7 @@
 #################################################################################
 
 basicConfig <- function() {
-  updateOptions('', level=levels['INFO'])
+  updateOptions('', level=loglevels['INFO'])
   addHandler(writeToConsole, name='basic.stdout')
   invisible()
 }

Modified: pkg/cleanup
===================================================================
--- pkg/cleanup	2010-04-01 08:39:13 UTC (rev 10)
+++ pkg/cleanup	2010-04-03 18:54:20 UTC (rev 11)
@@ -2,19 +2,30 @@
 
 rm ../logging*.tar.gz
 
-[[ $(svnversion -c .) =~ ([0-9]+):?([0-9]*)([A-Z]*) ]]
-LOW=${BASH_REMATCH[1]}
-HIGH=${BASH_REMATCH[2]:-$LOW}
-FLAGS=${BASH_REMATCH[3]:-''}
+# build high-date from files
+# $Id: logger.R 8906 2010-03-09 07:49:46Z Mario $
 
-# [ $LOW -ne $HIGH ] && echo "- mixed revisions in local copy (low:high=$LOW:$HIGH)"
-[ "$FLAGS" != "" ] && echo "- local copy has flags: $FLAGS"
-echo "- highest revision in local copy: $HIGH"
+MAX=$(egrep -hro "[$]Id: .*[$]" . | ( 
+  HIGH=0
+  while read line
+  do
+    RREV=$( echo $line | egrep -hro "[ ][0-9]+[ ]" ) 
+    if [ $RREV -gt $HIGH ] 
+    then 
+      HIGH=$RREV
+      maxline=$line
+    fi
+  done
+  echo $maxline
+))
 
+HIGH=$(( $( echo $MAX | egrep -hro "[ ][0-9]+[ ]" ) ))
+DATE=$( echo $MAX | egrep -hro "[0-9-]+[ ][0-9:]+Z" )
+
+echo "- $HIGH:$DATE"
+
 sed -re "s/(^Version:[^-]*).+$/\1-$HIGH/" DESCRIPTION.template > DESCRIPTION
 
-DATE=`LC_ALL=C svn info | awk '/^Last Changed Date:/ {print $4,$5}'`
-
 now=$(date)
 cat <<EOF > R/version.R
 # Do not edit!  This file was autogenerated
@@ -27,4 +38,3 @@
 SVNDATE <- "$DATE"
 
 EOF
-

Modified: pkg/inst/RUnit/runit.data.interaction.R
===================================================================
--- pkg/inst/RUnit/runit.data.interaction.R	2010-04-01 08:39:13 UTC (rev 10)
+++ pkg/inst/RUnit/runit.data.interaction.R	2010-04-03 18:54:20 UTC (rev 11)
@@ -1,6 +1,7 @@
 require(RUnit)
 
 # test functions are called in lexicographic order.
+# $Id$
 
 test.000.getLoggerWithoutInitializingDoesNotCrash <- function() {
   rootLogger <- getLogger("")
@@ -9,14 +10,14 @@
 test.001.defaultLoggingLevelIsINFO <- function() {
   basicConfig()
   rootLogger <- getLogger('')
-  expect <- levels['INFO']
+  expect <- logging:::loglevels['INFO']
   checkEquals(rootLogger[['level']], expect)
 }
 
 test.002.canInitializeTwice <- function() {
   basicConfig()
   rootLogger <- getLogger('')
-  expect <- levels['INFO']
+  expect <- logging:::loglevels['INFO']
   checkEquals(rootLogger[['level']], expect)
 }
 
@@ -29,25 +30,25 @@
 }
 
 test.canFindLoggingLevels <- function() {
-  checkEquals(logging::levels[['NOTSET']], 0)
-  checkEquals(logging::levels[['DEBUG']], 10)
-  checkEquals(logging::levels[['INFO']], 20)
-  checkEquals(logging::levels[['WARN']], 30)
-  checkEquals(logging::levels[['ERROR']], 40)
-  checkEquals(logging::levels[['FATAL']], 50)
+  checkEquals(logging:::loglevels[['NOTSET']], 0)
+  checkEquals(logging:::loglevels[['DEBUG']], 10)
+  checkEquals(logging:::loglevels[['INFO']], 20)
+  checkEquals(logging:::loglevels[['WARN']], 30)
+  checkEquals(logging:::loglevels[['ERROR']], 40)
+  checkEquals(logging:::loglevels[['FATAL']], 50)
 }
 
 test.fineLevelsAreOrdered <- function() {
-  checkEquals(logging::levels[['FINEST']] < logging::levels[['FINER']], TRUE)
-  checkEquals(logging::levels[['FINER']] < logging::levels[['FINE']], TRUE)
-  checkEquals(logging::levels[['FINE']] < logging::levels[['DEBUG']], TRUE)
+  checkEquals(logging:::loglevels[['FINEST']] < logging:::loglevels[['FINER']], TRUE)
+  checkEquals(logging:::loglevels[['FINER']] < logging:::loglevels[['FINE']], TRUE)
+  checkEquals(logging:::loglevels[['FINE']] < logging:::loglevels[['DEBUG']], TRUE)
 }
 
 test.canSetLoggerLevelByNamedValue <- function() {
   basicConfig()
-  setLevel('', levels['DEBUG'])
+  setLevel('', logging:::loglevels['DEBUG'])
   rootLogger <- getLogger('')
-  expect <- levels['DEBUG']
+  expect <- logging:::loglevels['DEBUG']
   checkEquals(rootLogger[['level']], expect)
 }
 
@@ -55,6 +56,6 @@
   basicConfig()
   setLevel('', 'DEBUG')
   rootLogger <- getLogger('')
-  expect <- levels['DEBUG']
+  expect <- logging:::loglevels['DEBUG']
   checkEquals(rootLogger[['level']], expect)
 }


Property changes on: pkg/inst/RUnit/runit.data.interaction.R
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: pkg/man/addHandler.Rd
===================================================================
--- pkg/man/addHandler.Rd	2010-04-01 08:39:13 UTC (rev 10)
+++ pkg/man/addHandler.Rd	2010-04-03 18:54:20 UTC (rev 11)
@@ -1,4 +1,5 @@
 % File src/R/man/addHandler.Rd
+% $Id$
 
 \name{addHandler}
 \alias{addHandler}


Property changes on: pkg/man/addHandler.Rd
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: pkg/man/basicConfig.Rd
===================================================================
--- pkg/man/basicConfig.Rd	2010-04-01 08:39:13 UTC (rev 10)
+++ pkg/man/basicConfig.Rd	2010-04-03 18:54:20 UTC (rev 11)
@@ -1,4 +1,5 @@
 % File src/R/man/basicConfig.Rd
+% $Id$
 
 \name{basicConfig}
 \alias{basicConfig}
@@ -15,6 +16,6 @@
 \examples{
 library(logging)
 basicConfig()
-debug("not shown, basic is INFO")
-warn("shown and timestamped")
+logdebug("not shown, basic is INFO")
+logwarn("shown and timestamped")
 }
\ No newline at end of file


Property changes on: pkg/man/basicConfig.Rd
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: pkg/man/getLogger.Rd
===================================================================
--- pkg/man/getLogger.Rd	2010-04-01 08:39:13 UTC (rev 10)
+++ pkg/man/getLogger.Rd	2010-04-03 18:54:20 UTC (rev 11)
@@ -1,4 +1,5 @@
 % File src/R/man/getLogger.Rd
+% $Id$
 
 \name{getLogger}
 \alias{getLogger}


Property changes on: pkg/man/getLogger.Rd
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: pkg/man/handler-actions.Rd
===================================================================
--- pkg/man/handler-actions.Rd	2010-04-01 08:39:13 UTC (rev 10)
+++ pkg/man/handler-actions.Rd	2010-04-03 18:54:20 UTC (rev 11)
@@ -1,4 +1,5 @@
 % File src/R/man/logging.handler-actions.Rd
+% $Id$
 
 \name{handler-actions}
 \alias{handler-actions}


Property changes on: pkg/man/handler-actions.Rd
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: pkg/man/levels.Rd
===================================================================
--- pkg/man/levels.Rd	2010-04-01 08:39:13 UTC (rev 10)
+++ pkg/man/levels.Rd	2010-04-03 18:54:20 UTC (rev 11)
@@ -1,7 +1,8 @@
 % File src/R/man/levels.Rd
+% $Id$
 
-\name{levels}
-\alias{levels}
+\name{loglevels}
+\alias{loglevels}
 \title{the logging levels, names and values}
 \description{
   


Property changes on: pkg/man/levels.Rd
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: pkg/man/log.Rd
===================================================================
--- pkg/man/log.Rd	2010-04-01 08:39:13 UTC (rev 10)
+++ pkg/man/log.Rd	2010-04-03 18:54:20 UTC (rev 11)
@@ -1,15 +1,16 @@
 % File src/R/man/log.Rd
+% $Id$
 
 \name{levellog}
 \alias{levellog}
-\alias{finest}
-\alias{finer}
-\alias{fine}
-\alias{debug}
-\alias{info}
-\alias{warn}
-\alias{warning}
-\alias{error}
+\alias{logfinest}
+\alias{logfiner}
+\alias{logfine}
+\alias{logdebug}
+\alias{loginfo}
+\alias{logwarn}
+\alias{logwarning}
+\alias{logerror}
 \title{entry points for logging actions}
 \description{
   generate a log record and pass it to the logging system.
@@ -19,10 +20,10 @@
 
 }
 \usage{
-debug(msg, ..., logger='')
-info(msg, ..., logger='')
-warn(msg, ..., logger='')
-error(msg, ..., logger='')
+logdebug(msg, ..., logger='')
+loginfo(msg, ..., logger='')
+logwarn(msg, ..., logger='')
+logerror(msg, ..., logger='')
 
 levellog(level, msg, ..., logger='')
 }


Property changes on: pkg/man/log.Rd
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: pkg/man/logging-internal.Rd
===================================================================
--- pkg/man/logging-internal.Rd	2010-04-01 08:39:13 UTC (rev 10)
+++ pkg/man/logging-internal.Rd	2010-04-03 18:54:20 UTC (rev 11)
@@ -1,4 +1,6 @@
 % File src/R/man/logging-internal.Rd
+% $Id$
+
 \name{logging-internal}
 \title{undocumented internal functions and variables}
 \description{


Property changes on: pkg/man/logging-internal.Rd
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: pkg/man/logging-package.Rd
===================================================================
--- pkg/man/logging-package.Rd	2010-04-01 08:39:13 UTC (rev 10)
+++ pkg/man/logging-package.Rd	2010-04-03 18:54:20 UTC (rev 11)
@@ -1,4 +1,5 @@
 % File src/R/man/logging-package.Rd
+% $Id$
 
 \name{logging-package}
 \Rdversion{1.1}


Property changes on: pkg/man/logging-package.Rd
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: pkg/man/removeHandler.Rd
===================================================================
--- pkg/man/removeHandler.Rd	2010-04-01 08:39:13 UTC (rev 10)
+++ pkg/man/removeHandler.Rd	2010-04-03 18:54:20 UTC (rev 11)
@@ -1,4 +1,5 @@
 % File src/R/man/removeHandler.Rd
+% $Id$
 
 \name{removeHandler}
 \alias{removeHandler}


Property changes on: pkg/man/removeHandler.Rd
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: pkg/man/setLevel.Rd
===================================================================
--- pkg/man/setLevel.Rd	2010-04-01 08:39:13 UTC (rev 10)
+++ pkg/man/setLevel.Rd	2010-04-03 18:54:20 UTC (rev 11)
@@ -1,4 +1,5 @@
 % File src/R/man/setLevel.Rd
+% $Id$
 
 \name{setLevel}
 \alias{setLevel}


Property changes on: pkg/man/setLevel.Rd
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: pkg/tests/doRUnit.R
===================================================================
--- pkg/tests/doRUnit.R	2010-04-01 08:39:13 UTC (rev 10)
+++ pkg/tests/doRUnit.R	2010-04-03 18:54:20 UTC (rev 11)
@@ -1,5 +1,7 @@
 #!/usr/bin/Rscript
 ## unit tests will not be done if RUnit is not available
+## $Id$
+
 if(require("RUnit", quietly=TRUE)) {
 
   ## --- Setup ---


Property changes on: pkg/tests/doRUnit.R
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: www/index.php
===================================================================
--- www/index.php	2010-04-01 08:39:13 UTC (rev 10)
+++ www/index.php	2010-04-03 18:54:20 UTC (rev 11)
@@ -1,6 +1,7 @@
 
 <!-- This is the project specific website template -->
 <!-- It can be changed as liked or replaced by other content -->
+<!-- $Id$ -->
 
 <?php
 


Property changes on: www/index.php
___________________________________________________________________
Name: svn:keywords
   + Id



More information about the Logging-commits mailing list