Beginning with v2.0.0, logging is now a core
component of the HawkinAuth object. This ensures that every
API request, token refresh, and data transformation is recorded
according to your preferred verbosity.
hawkinR utilizes the logger package to provide status
changes, background processes, and debugging information. This is
particularly useful for batch jobs (ETL) where monitoring the health of
the connection is critical.
In the current version, logging is initialized when you establish
your connection via hd_connect(). You no longer need a
separate initialization step.
You can set the log_level parameter in
hd_connect() to one of the following: *
"TRACE": Detailed execution logs (including request paths).
* "DEBUG": Information useful for debugging. *
"INFO": (Default) Standard process updates. *
"WARN": Warnings about token expiration or non-critical
issues. * "ERROR": Critical failures.
By default, hd_connect() sets the log level to “INFO”,
which prints successful connection and data retrieval messages to the
console.
If you are troubleshooting a specific issue (e.g., an “Unauthorized” error or unexpected data filtering), use the “DEBUG” or “TRACE” levels.
The package handles console output (stdout) by default. If you wish to redirect logs to a file for long-term auditing, you can use the logger package functions directly after connecting: