Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update read me #65

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Why use `loggit2`?
- _Zero_ external dependencies

Additionally, the boilerplate to get going with `loggit2` is minimal at worst.
No need to write custom formatters, handlers, levels, etc. -- ***just loggit2!***
No need to write custom formatters, handlers, levels, etc. -- ***just loggit!***

Usage
--------------
Expand Down Expand Up @@ -105,7 +105,7 @@ or, get the latest development version from GitHub via

Acknowledgments
-----------
This package is based on the [eponymous package by Ryan Price](https://github.com/ryapric/loggit), specifically version 2.1.1.
This package is based on the ["loggit" package by Ryan Price](https://github.com/ryapric/loggit), specifically version 2.1.1.

Due to technical reasons, this repository is not a GitHub fork of [Ryan's repository](https://github.com/ryapric/loggit).

Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ for the Getting Started guide.

Additionally, the boilerplate to get going with `loggit2` is minimal at
worst. No need to write custom formatters, handlers, levels, etc. –
***just loggit2!***
***just loggit!***

## Usage

Expand All @@ -44,13 +44,13 @@ at the desired locations.

``` r
loggit2::message("This is a message")
#> {"timestamp": "2024-05-02T18:27:28+0200", "log_lvl": "INFO", "log_msg": "This is a message__LF__"}
#> {"timestamp": "2024-05-03T21:30:47+0200", "log_lvl": "INFO", "log_msg": "This is a message__LF__"}
#> This is a message
loggit2::warning("This is a warning")
#> {"timestamp": "2024-05-02T18:27:28+0200", "log_lvl": "WARN", "log_msg": "This is a warning"}
#> {"timestamp": "2024-05-03T21:30:47+0200", "log_lvl": "WARN", "log_msg": "This is a warning"}
#> Warning: This is a warning
loggit2::stop("This is an error")
#> {"timestamp": "2024-05-02T18:27:28+0200", "log_lvl": "ERROR", "log_msg": "This is an error"}
#> {"timestamp": "2024-05-03T21:30:47+0200", "log_lvl": "ERROR", "log_msg": "This is an error"}
#> Error in eval(expr, envir, enclos): This is an error
```

Expand Down Expand Up @@ -83,18 +83,18 @@ it’ll become a structured log.

``` r
loggit2::loggit("ERROR", "This will log an error", anything_else = "you want to include")
#> {"timestamp": "2024-05-02T18:27:28+0200", "log_lvl": "ERROR", "log_msg": "This will log an error", "anything_else": "you want to include"}
#> {"timestamp": "2024-05-03T21:30:47+0200", "log_lvl": "ERROR", "log_msg": "This will log an error", "anything_else": "you want to include"}

# Read log file into data frame to implement logic based on entries
loggit2::read_logs()
#> timestamp log_lvl log_msg anything_else
#> 1 2024-05-02T18:27:28+0200 INFO This is a message\n
#> 2 2024-05-02T18:27:28+0200 WARN This is a warning
#> 3 2024-05-02T18:27:28+0200 ERROR This is an error
#> 4 2024-05-02T18:27:28+0200 INFO This is another message\n
#> 5 2024-05-02T18:27:28+0200 WARN This is another warning
#> 6 2024-05-02T18:27:28+0200 ERROR This is another error
#> 7 2024-05-02T18:27:28+0200 ERROR This will log an error you want to include
#> 1 2024-05-03T21:30:47+0200 INFO This is a message\n <NA>
#> 2 2024-05-03T21:30:47+0200 WARN This is a warning <NA>
#> 3 2024-05-03T21:30:47+0200 ERROR This is an error <NA>
#> 4 2024-05-03T21:30:47+0200 INFO This is another message\n <NA>
#> 5 2024-05-03T21:30:47+0200 WARN This is another warning <NA>
#> 6 2024-05-03T21:30:47+0200 ERROR This is another error <NA>
#> 7 2024-05-03T21:30:47+0200 ERROR This will log an error you want to include
```

Check out the
Expand All @@ -113,7 +113,7 @@ or, get the latest development version from GitHub via

## Acknowledgments

This package is based on the [eponymous package by Ryan
This package is based on the [“loggit” package by Ryan
Price](https://github.com/ryapric/loggit), specifically version 2.1.1.

Due to technical reasons, this repository is not a GitHub fork of
Expand Down
Loading