Skip to content

Commit

Permalink
Merge pull request #173 from AdamSelene/master
Browse files Browse the repository at this point in the history
Add 'shortener_keys' to configuration
  • Loading branch information
ezarowny committed Jun 23, 2017
2 parents 0baeaaa + caa71fa commit e78e344
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,31 @@ Default: `True`
<dt>verify_https
</dt>
<dd>If `True`, network requests will fail unless encountering a valid certificate. Default `True`.
</dd>
<dt>shortener_keys
</dt>
<dd>A list of key prefixes (as tuple) to apply our shortener transform to. Added to built-in list:

```
[
('body', 'request', 'POST'),
('body', 'request', 'json')
]
```

If `locals.enabled` is `True`, extra keys are also automatically added:

```
[
('body', 'trace', 'frames', '*', 'code'),
('body', 'trace', 'frames', '*', 'args', '*'),
('body', 'trace', 'frames', '*', 'kwargs', '*'),
('body', 'trace', 'frames', '*', 'locals', '*')
]
```

Default: `[]`

</dd>
</dd>
</dl>
Expand Down
5 changes: 4 additions & 1 deletion rollbar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ def _get_pylons_request():
'sizes': DEFAULT_LOCALS_SIZES,
'whitelisted_types': []
},
'verify_https': True
'verify_https': True,
'shortener_keys': []
}

# Set in init()
Expand Down Expand Up @@ -320,6 +321,8 @@ def init(access_token, environment='production', **kw):
shortener_keys.append(('body', 'trace', 'frames', '*', 'kwargs', '*'))
shortener_keys.append(('body', 'trace', 'frames', '*', 'locals', '*'))

shortener_keys.extend(SETTINGS['shortener_keys'])

shortener = ShortenerTransform(safe_repr=SETTINGS['locals']['safe_repr'],
keys=shortener_keys,
**SETTINGS['locals']['sizes'])
Expand Down

0 comments on commit e78e344

Please sign in to comment.