[Logging-commits] r61 - in pkg: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Feb 11 12:34:43 CET 2011


Author: mariotomo
Date: 2011-02-11 12:34:43 +0100 (Fri, 11 Feb 2011)
New Revision: 61

Added:
   pkg/R/methods.R
Modified:
   pkg/DESCRIPTION
   pkg/NAMESPACE
Log:
added basic S4 capability.
very basic and very quick and dirty!


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2011-02-02 09:47:04 UTC (rev 60)
+++ pkg/DESCRIPTION	2011-02-11 11:34:43 UTC (rev 61)
@@ -1,10 +1,10 @@
 Package: logging
-Version: 0.4-60
+Version: 0.5-0
 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.9.2)
+Depends: R (>= 2.9.2), methods
 Suggests: svUnit

Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE	2011-02-02 09:47:04 UTC (rev 60)
+++ pkg/NAMESPACE	2011-02-11 11:34:43 UTC (rev 61)
@@ -10,6 +10,7 @@
        levellog,
        basicConfig,
        getLogger,
+       Logger,
        removeHandler,
        removeHandler.default,
        removeHandler.character,

Added: pkg/R/methods.R
===================================================================
--- pkg/R/methods.R	                        (rev 0)
+++ pkg/R/methods.R	2011-02-11 11:34:43 UTC (rev 61)
@@ -0,0 +1,40 @@
+##***********************************************************************
+## 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) },
+                        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"], ...) }
+                        ))


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



More information about the Logging-commits mailing list