[Logging-commits] r72 - in handlers/pkg: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Apr 27 09:02:27 CEST 2011


Author: mariotomo
Date: 2011-04-27 09:02:24 +0200 (Wed, 27 Apr 2011)
New Revision: 72

Added:
   handlers/pkg/man/sentry.Rd
Modified:
   handlers/pkg/R/sentry.R
Log:
work in progress


Modified: handlers/pkg/R/sentry.R
===================================================================
--- handlers/pkg/R/sentry.R	2011-04-26 15:05:11 UTC (rev 71)
+++ handlers/pkg/R/sentry.R	2011-04-27 07:02:24 UTC (rev 72)
@@ -30,8 +30,10 @@
   if (!exists('server', envir=conf))
     stop("handler with sentryAction must have a 'server' element.\n")
 
-  stopifnot(require(RCurl),
-            require(rjson))
+  if(!all(c(require(RCurl),
+            require(Ruuid),
+            require(rjson))))
+    stop("sentryAction depends on RCurl, Ruuid, rjson.")
 
   if(missing(record))
     stop("sentryAction needs to receive the logging record.\n")
@@ -40,6 +42,8 @@
   ## biocLite("Ruuid")
 
   functionCallStack = sys.calls()
+  print(functionCallStack)
+
   data <- list(timestamp=record$timestamp,
                level=record$level,
                message=msg,

Added: handlers/pkg/man/sentry.Rd
===================================================================
--- handlers/pkg/man/sentry.Rd	                        (rev 0)
+++ handlers/pkg/man/sentry.Rd	2011-04-27 07:02:24 UTC (rev 72)
@@ -0,0 +1,37 @@
+% File man/sentry.Rd
+% $Id: getLogger.Rd 11 2010-04-03 18:54:20Z mariotomo $
+
+\name{sentry}
+\alias{sentryHandler}
+\title{the `sentryHandler` action function}
+\description{
+
+  the `sentryHandler` function can be registered as action to a
+  handler.  it sends formatted records to a sentry
+  server.
+
+}
+\details{
+  the handler environment needs to contain the URL of the sentry server.
+}
+\usage{
+logger <- Logger$new(name=name)
+logger$addHandler(some_name, sentryHandler, server=some_url)
+}
+\arguments{
+  \item{msg}{the formatted record}
+  \item{conf}{the handler environment}
+  \item{record}{the full unformatted record}
+}
+\examples{
+library(logging)
+library(logging.handlers)
+
+basicConfig()
+
+log <- Logger$new(name="")
+log$addHandler("sentry", sentryHandler, server="http://sentry.somedomain.com/")
+
+log$debug("not sent, basic is INFO")
+log$warn("sent and timestamped")
+}


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



More information about the Logging-commits mailing list