README.md

teal.logger

CRAN Version Total Downloads Last Month Downloads Last Week Downloads

Check 🛠 Docs 📚 Code Coverage 📔

GitHub forks GitHub repo stars

GitHub commit activity GitHub contributors GitHub last commit GitHub pull requests GitHub repo size GitHub language count Project Status: Active – The project has reached a stable, usable state and is being actively developed. Current Version Open Issues

teal.logger is an R package providing a unified setup for generating logs using the logger package.

Installation

# stable versions
install.packages('teal.logger')

# install.packages("pak")
pak::pak("insightsengineering/teal.logger@*release")

Alternatively, you might want to use the development version available on r-universe.

# beta versions
install.packages('teal.logger', repos = c('https://pharmaverse.r-universe.dev', getOption('repos')))

# install.packages("pak")
pak::pak("insightsengineering/teal.logger")

Usage

To understand how to use this package, please refer to the Getting Started article, which provides multiple examples of code implementation.

Below is the showcase of the example usage

library(teal.logger)
register_logger(namespace = "namespace1", level = "INFO")
logger::log_info("Hello from namespace1", namespace = "namespace1")
logger::log_warn("Hello from namespace1", namespace = "namespace1")
logger::log_success("Hello from namespace1", namespace = "namespace1")
# [INFO] 2023-08-31 12:02:41.0678 pid:7128 token:[] namespace1 Hello from namespace1
# [WARN] 2023-08-31 12:02:42.4872 pid:7128 token:[] namespace1 Hello from namespace
# [SUCCESS] 2023-08-31 12:02:58.7155 pid:7128 token:[] namespace1 Hello from namespace

register_logger(namespace = "namespace2", level = "WARN")
logger::log_info("Hello from namespace2", namespace = "namespace2")
logger::log_warn("Hello from namespace2", namespace = "namespace2")
logger::log_error("Hello from namespace2", namespace = "namespace2")
# [WARN] 2023-08-31 12:04:34.9361 pid:7128 token:[] namespace2 Hello from namespace2
# [ERROR] 2023-08-31 12:04:35.5721 pid:7128 token:[] namespace2 Hello from namespace2

Getting help

If you encounter a bug or you have a feature request - please file an issue. For questions, discussions and staying up to date, please use the "teal" channel in the pharmaverse slack workspace.

Stargazers and Forkers

Stargazers over time

Stargazers over time

Stargazers

Stargazers repo roster for @insightsengineering/teal.logger

Forkers

Forkers repo roster for @insightsengineering/teal.logger



Try the teal.logger package in your browser

Any scripts or data that you put into this service are public.

teal.logger documentation built on May 29, 2024, 9:14 a.m.