diff --git a/.gitignore b/.gitignore index 24c5d82..63afd83 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ rollbar.test .env cover.out cover.html +.idea +.vscode \ No newline at end of file diff --git a/client.go b/client.go index f8ab8bc..5819e6e 100644 --- a/client.go +++ b/client.go @@ -151,6 +151,30 @@ func (c *Client) SetFingerprint(fingerprint bool) { c.configuration.fingerprint = fingerprint } +// Enables custom client-side fingerprint. The default value is false. +func (c *Client) EnableClientsideFingerprintGeneration() { + c.diagnostic.configuredOptions["fingerprint"] = true + c.configuration.fingerprint = true +} + +// Disables custom client-side fingerprint. The default value is false. +func (c *Client) DisableClientsideFingerprintGeneration() { + c.diagnostic.configuredOptions["fingerprint"] = false + c.configuration.fingerprint = false +} + +// Enables custom client-side fingerprint. The default value is false. (Alias of above method). +func (c *Client) EnableClientsideFingerprint() { + c.diagnostic.configuredOptions["fingerprint"] = true + c.configuration.fingerprint = true +} + +// Disables custom client-side fingerprint. The default value is false. (Alias of above method). +func (c *Client) DisableClientsideFingerprint() { + c.diagnostic.configuredOptions["fingerprint"] = false + c.configuration.fingerprint = false +} + // SetLogger sets the logger on the underlying transport. By default log.Printf is used. func (c *Client) SetLogger(logger ClientLogger) { c.Transport.SetLogger(logger) diff --git a/rollbar.go b/rollbar.go index 860fc47..1c4aa41 100644 --- a/rollbar.go +++ b/rollbar.go @@ -90,6 +90,27 @@ var DefaultStackTracer StackTracerFunc = func(err error) ([]runtime.Frame, bool) return nil, false } +// Enables a custom client-side fingerprint. The default value is false. +func EnableClientsideFingerprintGeneration() { + std.SetFingerprint(true) +} + +// Disables a custom client-side fingerprint. The default value is false. +func DisableClientsideFingerprintGeneration() { + std.SetFingerprint(false) +} + +// Enables a custom client-side fingerprint. The default value is false. (Alias of above method). +func EnableClientsideFingerprint() { + std.SetFingerprint(true) +} + +// Disables a custom client-side fingerprint. The default value is false. (Alias of above method). +func DisableClientsideFingerprint() { + std.SetFingerprint(false) +} + + // SetEnabled sets whether or not the managed Client instance is enabled. // If this is true then this library works as normal. // If this is false then no calls will be made to the network.