luzlogr: A Logging Framework for R

> library(luzlogr)
> openlog("test.log")

バージョン: 0.1.1


関数名 概略
closelog Close current logfile
luzlogr Lightweight logging for R
openlog Open a new logfile
printlog Log a message

closelog

> closelog(sessionInfo = TRUE)
> readLines("test.log")
 [1] "Wed Jan 13 17:37:53 2016  Opening test.log "                              
 [2] "Wed Jan 13 17:37:53 2016  Closing test.log flags = 0 "                    
 [3] "-------"                                                                  
 [4] "R version 3.2.3 (2015-12-10)"                                             
 [5] "Platform: x86_64-apple-darwin13.4.0 (64-bit)"                             
 [6] "Running under: OS X 10.11.2 (El Capitan)"                                 
 [7] ""                                                                         
 [8] "locale:"                                                                  
 [9] "[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8"        
[10] ""                                                                         
[11] "attached base packages:"                                                  
[12] "[1] stats     graphics  grDevices utils     datasets  methods   base     "
[13] ""                                                                         
[14] "other attached packages:"                                                 
[15] " [1] Rgitbook_0.9        loggr_0.3           luzlogr_0.1.1      "         
[16] " [4] log4r_0.2           remoji_0.1.0        ggplot2_2.0.0      "         
[17] " [7] pipeR_0.6.0.6       magrittr_1.5        knitr_1.11.8       "         
[18] "[10] devtools_1.9.1.9000"                                                 
[19] ""                                                                         
[20] "loaded via a namespace (and not attached):"                               
[21] " [1] Rcpp_0.12.2         knitcitations_1.0.7 munsell_0.4.2      "         
[22] " [4] colorspace_1.2-6    R6_2.1.1            bibtex_0.4.0       "         
[23] " [7] highr_0.5.1         httr_1.0.0          stringr_1.0.0      "         
[24] "[10] plyr_1.8.3          tools_3.2.3         grid_3.2.3         "         
[25] "[13] gtable_0.1.2        cowsay_0.4.0        fortunes_1.5-2     "         
[26] "[16] digest_0.6.9        assertthat_0.1      RJSONIO_1.3-0      "         
[27] "[19] formatR_1.2.1       readr_0.2.2         RefManageR_0.10.5  "         
[28] "[22] bitops_1.0-6        RCurl_1.95-4.7      rsconnect_0.4.1.11 "         
[29] "[25] evaluate_0.8        memoise_0.2.1       DYM_0.1.1          "         
[30] "[28] stringi_1.0-1       scales_0.3.0        XML_3.98-1.3       "         
[31] "[31] lubridate_1.5.0    "

openlog

> openlog("test.log")
> readLines("test.log")
[1] "Wed Jan 13 17:37:53 2016  Opening test.log "

printlog

ログを保存する

Arguments

  • ...
  • level
  • ts
  • cr
  • flag
> printlog("message!", loglevel = 1, ts = TRUE)
> printlog(dim(cars), flag = TRUE)
> readLines("test.log")
[1] "Wed Jan 13 17:37:53 2016  Opening test.log "
[2] "Wed Jan 13 17:37:53 2016  message! 1 "      
[3] "** Flagged message: **"                     
[4] "Wed Jan 13 17:37:53 2016  502 "