@@ -23,7 +23,7 @@ Users that have not worked with R6 classes before, will find configuring
2323Loggers a bit strange and verbose, but care was taken to keep the syntax
2424for common logging tasks and interactive usage simple and concise. User
2525that have experience with [ shiny] ( https://github.com/rstudio/shiny ) ,
26- [ plumber] ( https://github.com/trestletech /plumber ) , [ python
26+ [ plumber] ( https://github.com/rstudio /plumber ) , [ python
2727logging] ( https://docs.python.org/3/library/logging.html ) or [ Apache
2828Log4j] ( https://logging.apache.org/log4j/2.x/ ) will feel at home. User
2929that are proficient with R6 classes will also find it easy to extend and
@@ -65,13 +65,13 @@ vignette.
6565
6666``` r
6767lgr $ fatal(" A critical error" )
68- # > FATAL [10:55:49.023 ] A critical error
68+ # > FATAL [17:25:32.336 ] A critical error
6969lgr $ error(" A less severe error" )
70- # > ERROR [10:55:49.145 ] A less severe error
70+ # > ERROR [17:25:32.401 ] A less severe error
7171lgr $ warn(" A potentially bad situation" )
72- # > WARN [10:55:49.202 ] A potentially bad situation
72+ # > WARN [17:25:32.421 ] A potentially bad situation
7373lgr $ info(" iris has %s rows" , nrow(iris ))
74- # > INFO [10:55:49.217 ] iris has 150 rows
74+ # > INFO [17:25:32.425 ] iris has 150 rows
7575
7676# the following log levels are hidden by default
7777lgr $ debug(" A debug message" )
@@ -85,9 +85,9 @@ appender to log to a file with little effort.
8585tf <- tempfile()
8686lgr $ add_appender(AppenderFile $ new(tf , layout = LayoutJson $ new()))
8787lgr $ info(" cars has %s rows" , nrow(cars ))
88- # > INFO [10:55:49.270 ] cars has 50 rows
88+ # > INFO [17:25:32.458 ] cars has 50 rows
8989cat(readLines(tf ))
90- # > {"level":400,"timestamp":"2020-10-17 10:55:49 ","logger":"root","caller":"eval","msg":"cars has 50 rows"}
90+ # > {"level":400,"timestamp":"2020-10-17 17:25:32 ","logger":"root","caller":"eval","msg":"cars has 50 rows"}
9191```
9292
9393By passing a named argument to ` info() ` , ` warn() ` , and co you can log
@@ -97,10 +97,10 @@ logfiles that are machine as well as (somewhat) human readable.
9797
9898``` r
9999lgr $ info(" loading cars" , " cars" , rows = nrow(cars ), cols = ncol(cars ))
100- # > INFO [10:55:49.322 ] loading cars {rows: 50, cols: 2}
100+ # > INFO [17:25:32.502 ] loading cars {rows: 50, cols: 2}
101101cat(readLines(tf ), sep = " \n " )
102- # > {"level":400,"timestamp":"2020-10-17 10:55:49 ","logger":"root","caller":"eval","msg":"cars has 50 rows"}
103- # > {"level":400,"timestamp":"2020-10-17 10:55:49 ","logger":"root","caller":"eval","msg":"loading cars","rows":50,"cols":2}
102+ # > {"level":400,"timestamp":"2020-10-17 17:25:32 ","logger":"root","caller":"eval","msg":"cars has 50 rows"}
103+ # > {"level":400,"timestamp":"2020-10-17 17:25:32 ","logger":"root","caller":"eval","msg":"loading cars","rows":50,"cols":2}
104104```
105105
106106For more examples please see the package
@@ -243,5 +243,5 @@ to post a feature request on the issue tracker.
243243
244244## Acknowledgement
245245
246- - [ Inkscape ] ( https://inkscape.org / ) for the hex sticker
247- - [ draw.io ] ( https://draw.io/ ) for the flow chart in the vignette
246+ - [ diagrams.net ] ( https://app.diagrams.net / ) for the flow chart in the
247+ vignette
0 commit comments