Skip to contents

Get the configuration value of a specific key which was set (or not set) using set_log_config function. If nothing was set, then it reuses the default value defined in the function signature of set_log_config function.

Usage

get_log_config(key = NULL)

Arguments

key

Specify the key whose value needs to be extracted. NULL implies no specific key, rather all of them to be extracted at once.

Value

Returns the respective configuration value of the given key. If key is NULL, then all the configuration values will be returned together as a list.

Examples

  # Get configuration value without setting anything
  get_log_config("log_to_azure")
#> [1] TRUE
  # Set some configuration first and then get the respective values
  set_log_config(enforce_tz_utc = FALSE, log_to_azure = FALSE)
  get_log_config("enforce_tz_utc")
#> [1] FALSE
  get_log_config("log_to_azure")
#> [1] FALSE
  # Reset the values
  set_log_config()
  get_log_config("log_to_azure")
#> [1] TRUE

  # Extract list of all configurations
  get_log_config()
#> $log_fields
#> [1] "level" "time"  "msg"  
#> 
#> $additional_fields
#> NULL
#> 
#> $enforce_ascii_msg
#> [1] TRUE
#> 
#> $enforce_tz_utc
#> [1] TRUE
#> 
#> $log_to_azure
#> [1] TRUE
#> 
#> $log_type
#> [1] "log_from_r"
#> 
#> $customer_id_env
#> [1] "AZ_LOG_ID"
#> 
#> $shared_key_env
#> [1] "AZ_LOG_KEY"
#>