[Logging-commits] r65 - / oo oo/pkg oo/pkg/R oo/pkg/man pkg pkg/R pkg/man proto proto/pkg proto/pkg/R proto/pkg/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Apr 15 15:43:18 CEST 2011


Author: mariotomo
Date: 2011-04-15 15:43:17 +0200 (Fri, 15 Apr 2011)
New Revision: 65

Added:
   oo/
   oo/pkg/
   oo/pkg/DESCRIPTION
   oo/pkg/NAMESPACE
   oo/pkg/R/
   oo/pkg/R/methods.R
   oo/pkg/man/
   oo/pkg/man/Logger.Rd
   proto/
   proto/pkg/
   proto/pkg/DESCRIPTION
   proto/pkg/NAMESPACE
   proto/pkg/R/
   proto/pkg/R/proto.R
   proto/pkg/man/
   proto/pkg/man/Logger.Rd
Removed:
   pkg/R/methods.R
   pkg/man/Logger.Rd
Modified:
   pkg/DESCRIPTION
   pkg/NAMESPACE
   pkg/R/logger.R
Log:
creating two subpackages: logging.oo and logging.proto, that implement
two equivalent object oriented shells on top of the logging package.


Added: oo/pkg/DESCRIPTION
===================================================================
--- oo/pkg/DESCRIPTION	                        (rev 0)
+++ oo/pkg/DESCRIPTION	2011-04-15 13:43:17 UTC (rev 65)
@@ -0,0 +1,10 @@
+Package: logging.oo
+Version: 0.5-65
+Date: 2010-06-17
+Title: oo interface for the logging package
+Author: Mario Frasca <mariotomo at gmail.com>
+Maintainer: Mario Frasca <mario.frasca at nelen-schuurmans.nl>
+Description: a logging package emulating the python logging package.
+License: GPL (>=2)
+Depends: R (>= 2.12.0), logging, methods
+Suggests: svUnit

Added: oo/pkg/NAMESPACE
===================================================================
--- oo/pkg/NAMESPACE	                        (rev 0)
+++ oo/pkg/NAMESPACE	2011-04-15 13:43:17 UTC (rev 65)
@@ -0,0 +1,3 @@
+# $Id: NAMESPACE 61 2011-02-11 11:34:43Z mariotomo $
+export(Logger
+       )

Copied: oo/pkg/R/methods.R (from rev 64, pkg/R/methods.R)
===================================================================
--- oo/pkg/R/methods.R	                        (rev 0)
+++ oo/pkg/R/methods.R	2011-04-15 13:43:17 UTC (rev 65)
@@ -0,0 +1,44 @@
+##***********************************************************************
+## this program is free software: you can redistribute it and/or
+## modify it under the terms of the GNU General Public License as
+## published by the Free Software Foundation, either version 3 of the
+## License, or (at your option) any later version.
+##
+## this program is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with the nens libraray.  If not, see
+## <http://www.gnu.org/licenses/>.
+##
+## Library    : logging
+##
+## Purpose    : emulate the python standard logging package
+##
+## Usage      : library(logging)
+##
+## $Id: logger.R 60 2011-02-02 09:47:04Z mariotomo $
+##
+## initial programmer :  Mario Frasca
+##
+## initial date       :  20110211
+##
+
+Logger <- setRefClass("Logger",
+                      fields=list(
+                        name = "character"),
+                      methods=list(
+                        log = function(...) { levellog(..., logger=name) },
+
+                        setLevel = function(newLevel) { logging::setLevel(newLevel, container=name) },
+                        addHandler = function(...) { logging::addHandler(..., logger=name) },
+
+                        finest = function(...) { log(loglevels['FINEST'], ...) },
+                        finer = function(...) { log(loglevels['FINER'], ...) },
+                        fine = function(...) { log(loglevels['FINE'], ...) },
+                        debug = function(...) { log(loglevels['DEBUG'], ...) },
+                        info = function(...) { log(loglevels["INFO"], ...) },
+                        warn = function(...) { log(loglevels["WARN"], ...) },
+                        error = function(...) { log(loglevels["ERROR"], ...) }))

Copied: oo/pkg/man/Logger.Rd (from rev 64, pkg/man/Logger.Rd)
===================================================================
--- oo/pkg/man/Logger.Rd	                        (rev 0)
+++ oo/pkg/man/Logger.Rd	2011-04-15 13:43:17 UTC (rev 65)
@@ -0,0 +1,25 @@
+% File src/R/man/getLogger.Rd
+% $Id: getLogger.Rd 11 2010-04-03 18:54:20Z mariotomo $
+
+\name{Logger}
+\alias{Logger}
+\title{the `Logger` reference class}
+\description{
+
+  Logger is a quick and dirty adoption of the reference class paradigm.
+
+}
+\usage{
+logger <- Logger$new(name=name)
+}
+\arguments{
+  \item{name}{the name of the logger}
+}
+\examples{
+basicConfig()
+
+log <- Logger$new(name="")
+
+log$debug("not shown, basic is INFO")
+log$warn("shown and timestamped")
+}
\ No newline at end of file

Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2011-02-28 07:50:35 UTC (rev 64)
+++ pkg/DESCRIPTION	2011-04-15 13:43:17 UTC (rev 65)
@@ -1,10 +1,10 @@
 Package: logging
-Version: 0.5-64
+Version: 0.5-65
 Date: 2010-06-17
 Title: a tentative logging package
 Author: Mario Frasca <mariotomo at gmail.com>
 Maintainer: Mario Frasca <mario.frasca at nelen-schuurmans.nl>
 Description: a logging package emulating the python logging package.
 License: GPL (>=2)
-Depends: R (>= 2.12.0), methods
+Depends: R (>= 2.11.0)
 Suggests: svUnit

Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE	2011-02-28 07:50:35 UTC (rev 64)
+++ pkg/NAMESPACE	2011-04-15 13:43:17 UTC (rev 65)
@@ -10,7 +10,6 @@
        levellog,
        basicConfig,
        getLogger,
-       Logger,
        removeHandler,
        removeHandler.default,
        removeHandler.character,

Modified: pkg/R/logger.R
===================================================================
--- pkg/R/logger.R	2011-02-28 07:50:35 UTC (rev 64)
+++ pkg/R/logger.R	2011-04-15 13:43:17 UTC (rev 65)
@@ -51,7 +51,7 @@
 
 .logrecord <- function(record, logger)
 {
-  ## get the logger of which we have the name.
+  ## 
   config <- getLogger(logger)
   
   if (record$level >= config$level) 
@@ -95,7 +95,7 @@
   record$timestamp <- sprintf("%s", Sys.time())
   record$logger <- logger
   record$level <- namedLevel(level)
-  record$levelname <- names(which(loglevels == level)[1])
+  record$levelname <- names(which(loglevels == record$level)[1])
   if(is.na(record$levelname))
     record$levelname <- paste("NumericLevel(", level, ")", sep='')
 

Deleted: pkg/R/methods.R
===================================================================
--- pkg/R/methods.R	2011-02-28 07:50:35 UTC (rev 64)
+++ pkg/R/methods.R	2011-04-15 13:43:17 UTC (rev 65)
@@ -1,44 +0,0 @@
-##***********************************************************************
-## this program is free software: you can redistribute it and/or
-## modify it under the terms of the GNU General Public License as
-## published by the Free Software Foundation, either version 3 of the
-## License, or (at your option) any later version.
-##
-## this program is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with the nens libraray.  If not, see
-## <http://www.gnu.org/licenses/>.
-##
-## Library    : logging
-##
-## Purpose    : emulate the python standard logging package
-##
-## Usage      : library(logging)
-##
-## $Id: logger.R 60 2011-02-02 09:47:04Z mariotomo $
-##
-## initial programmer :  Mario Frasca
-##
-## initial date       :  20110211
-##
-
-Logger <- setRefClass("Logger",
-                      fields=list(
-                        name = "character"),
-                      methods=list(
-                        log = function(...) { levellog(..., logger=name) },
-
-                        setLevel = function(newLevel) { logging::setLevel(newLevel, container=name) },
-                        addHandler = function(...) { logging::addHandler(..., logger=name) },
-
-                        finest = function(...) { log(loglevels['FINEST'], ...) },
-                        finer = function(...) { log(loglevels['FINER'], ...) },
-                        fine = function(...) { log(loglevels['FINE'], ...) },
-                        debug = function(...) { log(loglevels['DEBUG'], ...) },
-                        info = function(...) { log(loglevels["INFO"], ...) },
-                        warn = function(...) { log(loglevels["WARN"], ...) },
-                        error = function(...) { log(loglevels["ERROR"], ...) }))

Deleted: pkg/man/Logger.Rd
===================================================================
--- pkg/man/Logger.Rd	2011-02-28 07:50:35 UTC (rev 64)
+++ pkg/man/Logger.Rd	2011-04-15 13:43:17 UTC (rev 65)
@@ -1,26 +0,0 @@
-% File src/R/man/getLogger.Rd
-% $Id: getLogger.Rd 11 2010-04-03 18:54:20Z mariotomo $
-
-\name{Logger}
-\alias{Logger}
-\title{the `Logger` reference class}
-\description{
-
-  Logger is a quick and dirty adoption of the reference class paradigm.
-
-}
-\usage{
-logger <- Logger$new(name=name)
-}
-\arguments{
-  \item{name}{the name of the logger}
-}
-\examples{
-library(logging)
-basicConfig()
-
-log <- Logger$new(name="")
-
-log$debug("not shown, basic is INFO")
-log$warn("shown and timestamped")
-}
\ No newline at end of file

Added: proto/pkg/DESCRIPTION
===================================================================
--- proto/pkg/DESCRIPTION	                        (rev 0)
+++ proto/pkg/DESCRIPTION	2011-04-15 13:43:17 UTC (rev 65)
@@ -0,0 +1,10 @@
+Package: logging.proto
+Version: 0.5-65
+Date: 2010-06-17
+Title: proto interface to the logging package
+Author: Mario Frasca <mariotomo at gmail.com>
+Maintainer: Mario Frasca <mario.frasca at nelen-schuurmans.nl>
+Description: a logging package emulating the python logging package.
+License: GPL (>=2)
+Depends: R (>= 2.11.0), logging, proto
+Suggests: svUnit

Added: proto/pkg/NAMESPACE
===================================================================
--- proto/pkg/NAMESPACE	                        (rev 0)
+++ proto/pkg/NAMESPACE	2011-04-15 13:43:17 UTC (rev 65)
@@ -0,0 +1,3 @@
+# $Id: NAMESPACE 61 2011-02-11 11:34:43Z mariotomo $
+export(Logger
+       )

Added: proto/pkg/R/proto.R
===================================================================
--- proto/pkg/R/proto.R	                        (rev 0)
+++ proto/pkg/R/proto.R	2011-04-15 13:43:17 UTC (rev 65)
@@ -0,0 +1,53 @@
+##***********************************************************************
+## this program is free software: you can redistribute it and/or
+## modify it under the terms of the GNU General Public License as
+## published by the Free Software Foundation, either version 3 of the
+## License, or (at your option) any later version.
+##
+## this program is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with the nens libraray.  If not, see
+## <http://www.gnu.org/licenses/>.
+##
+## Library    : logging
+##
+## Purpose    : emulate the python standard logging package
+##
+## Usage      : library(logging)
+##
+## $Id: logger.R 60 2011-02-02 09:47:04Z mariotomo $
+##
+## initial programmer :  Mario Frasca
+##
+## initial date       :  20110301
+##
+
+Logger <- proto(
+                new = function(self, name) {
+                  self$proto(name = name) },
+                log = function(self, ...) {
+                  levellog(..., logger = self$name) },
+                
+                setLevel = function(self, newLevel) {
+                  logging::setLevel(newLevel, container = self$name) },
+                addHandler = function(self, ...) {
+                  logging::addHandler(self, ..., logger = self$name) },
+                
+                finest = function(self, ...) {
+                  self$log(loglevels['FINEST'], ...) },
+                finer = function(self, ...) {
+                  self$log(loglevels['FINER'], ...) },
+                fine = function(self, ...) {
+                  self$log(loglevels['FINE'], ...) },
+                debug = function(self, ...) {
+                  self$log(loglevels['DEBUG'], ...) },
+                info = function(self, ...) {
+                  self$log(loglevels["INFO"], ...) },
+                warn = function(self, ...) {
+                  self$log(loglevels["WARN"], ...) },
+                error = function(self, ...) {
+                  self$log(loglevels["ERROR"], ...) } )


Property changes on: proto/pkg/R/proto.R
___________________________________________________________________
Added: svn:eol-style
   + native

Added: proto/pkg/man/Logger.Rd
===================================================================
--- proto/pkg/man/Logger.Rd	                        (rev 0)
+++ proto/pkg/man/Logger.Rd	2011-04-15 13:43:17 UTC (rev 65)
@@ -0,0 +1,25 @@
+% File src/R/man/getLogger.Rd
+% $Id: getLogger.Rd 11 2010-04-03 18:54:20Z mariotomo $
+
+\name{Logger}
+\alias{Logger}
+\title{the `Logger` reference class}
+\description{
+
+  Logger is a quick and dirty adoption of the proto class paradigm.
+
+}
+\usage{
+logger <- Logger$new(name=name)
+}
+\arguments{
+  \item{name}{the name of the logger}
+}
+\examples{
+basicConfig()
+
+log <- Logger$new(name="")
+
+log$debug("not shown, basic is INFO")
+log$warn("shown and timestamped")
+}
\ No newline at end of file


Property changes on: proto/pkg/man/Logger.Rd
___________________________________________________________________
Added: svn:eol-style
   + native



More information about the Logging-commits mailing list