Struct honeybadger::ConfigBuilder [−][src]
pub struct ConfigBuilder { /* fields omitted */ }
Configuration builder struct, used for building a Config
instance
Methods
impl ConfigBuilder
[src]
impl ConfigBuilder
pub fn new(api_token: &str) -> Self
[src]
pub fn new(api_token: &str) -> Self
Construct a ConfigBuilder
to parametrize the Honeybadger client.
ConfigBuilder
is populated using environment variables, which will inject
Honeybadger event fields:
HONEYBADGER_ROOT
- project root for each event.ENV
- environment name for each event.HOSTNAME
- host name for each event.HONEYBADGER_ENDPOINT
- override the default endpoint for the HTTPS client.HONEYBADGER_TIMEOUT
- write timeout for the Honeybadger HTTPS client.
Arguments
api_token
- API key for the honeybadger project
Example
let api_token = "ffffff"; let config = ConfigBuilder::new(api_token);
pub fn build(self) -> Config
[src]
pub fn build(self) -> Config
Prepare a Config
instance for constructing a Honeybadger instance.
Defaults are set if the ConfigBuilder
used to construct the Config
is empty.
- default root: the current directory
- default hostname: the host name as reported by the operating system
- default endpoint: "https://api.honeybadger.io/v1/notices"
- default timeout: a 5 second client write timeout
- default threads: 4 threads are used in the asynchronous runtime pool
Example
ConfigBuilder::new(api_token).build();
Auto Trait Implementations
impl Send for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Sync for ConfigBuilder