| OLD | NEW |
| 1 # Copyright 2014 The LUCI Authors. All rights reserved. | 1 # Copyright 2014 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Manages user reports. | 5 """Manages user reports. |
| 6 | 6 |
| 7 These are DB stored reports, vs logservice based reports. This is for events | 7 These are DB stored reports, vs logservice based reports. This is for events |
| 8 like client failure or non exceptional server failure where more details is | 8 like client failure or non exceptional server failure where more details is |
| 9 desired. | 9 desired. |
| 10 """ | 10 """ |
| 11 | 11 |
| 12 import datetime | 12 import datetime |
| 13 import logging | 13 import logging |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 kwargs['source_ip'] = request.remote_addr | 93 kwargs['source_ip'] = request.remote_addr |
| 94 if add_params: | 94 if add_params: |
| 95 kwargs['params'] = request.params.mixed() | 95 kwargs['params'] = request.params.mixed() |
| 96 try: | 96 try: |
| 97 as_json = request.json | 97 as_json = request.json |
| 98 if isinstance(as_json, dict): | 98 if isinstance(as_json, dict): |
| 99 kwargs['params'].update(as_json) | 99 kwargs['params'].update(as_json) |
| 100 except (LookupError, TypeError, ValueError): | 100 except (LookupError, TypeError, ValueError): |
| 101 pass | 101 pass |
| 102 return log(**kwargs) | 102 return log(**kwargs) |
| OLD | NEW |