Skip to content

Commit 39c2fb7

Browse files
committed
[IMP] rest_log: pre-commit auto fixes
1 parent 35bca34 commit 39c2fb7

File tree

15 files changed

+100
-96
lines changed

15 files changed

+100
-96
lines changed

rest_log/README.rst

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@ REST Log
1717
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
1818
:alt: License: LGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github
20-
:target: https://github.com/OCA/rest-framework/tree/16.0/rest_log
20+
:target: https://github.com/OCA/rest-framework/tree/18.0/rest_log
2121
:alt: OCA/rest-framework
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/rest-framework-16-0/rest-framework-16-0-rest_log
23+
:target: https://translation.odoo-community.org/projects/rest-framework-18-0/rest-framework-18-0-rest_log
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&target_branch=16.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
3030

3131
When exposing REST services is often useful to see what's happening
3232
especially in case of errors.
3333

34-
This module add DB logging for REST requests.
35-
It also inject in the response the URL of the log entry created.
34+
This module add DB logging for REST requests. It also inject in the
35+
response the URL of the log entry created.
3636

37-
NOTE: this feature was implemented initially inside shopfloor app.
38-
Up to version 13.0.1.2.1 of this module,
39-
if shopfloor is installed, log records will be copied from its table.
37+
NOTE: this feature was implemented initially inside shopfloor app. Up to
38+
version 13.0.1.2.1 of this module, if shopfloor is installed, log
39+
records will be copied from its table.
4040

4141
**Table of contents**
4242

@@ -47,44 +47,48 @@ Configuration
4747
=============
4848

4949
Logs retention
50-
~~~~~~~~~~~~~~
50+
--------------
5151

52-
Logs are kept in database for every REST requests made by a client application.
53-
They can be used for debugging and monitoring of the activity.
52+
Logs are kept in database for every REST requests made by a client
53+
application. They can be used for debugging and monitoring of the
54+
activity.
5455

55-
The Logs menu is shown only with Developer tools (``?debug=1``) activated.
56+
The Logs menu is shown only with Developer tools (``?debug=1``)
57+
activated.
5658

57-
By default, REST logs are kept 30 days.
58-
You can change the duration of the retention by changing the System Parameter
59+
By default, REST logs are kept 30 days. You can change the duration of
60+
the retention by changing the System Parameter
5961
``rest.log.retention.days``.
6062

6163
If the value is set to 0, the logs are not stored at all.
6264

63-
Logged data is: request URL and method, parameters, headers, result or error.
64-
65+
Logged data is: request URL and method, parameters, headers, result or
66+
error.
6567

6668
Logs activation
67-
~~~~~~~~~~~~~~~
69+
---------------
6870

6971
You have 2 ways to activate logging:
7072

71-
* on the service component set `_log_calls_in_db = True`
72-
* via configuration
73+
- on the service component set \_log_calls_in_db = True
74+
- via configuration
7375

7476
In the 1st case, calls will be always be logged.
7577

76-
In the 2nd case you can set ``rest.log.active`` param as::
78+
In the 2nd case you can set ``rest.log.active`` param as:
79+
80+
::
7781

78-
`collection_name` # enable for all endpoints of the collection
79-
`collection_name.usage` # enable for specific endpoints
80-
`collection_name.usage.endpoint` # enable for specific endpoints
81-
`collection_name*:state` # enable only for specific state (success, failed)
82+
`collection_name` # enable for all endpoints of the collection
83+
`collection_name.usage` # enable for specific endpoints
84+
`collection_name.usage.endpoint` # enable for specific endpoints
85+
`collection_name*:state` # enable only for specific state (success, failed)
8286

8387
Changelog
8488
=========
8589

8690
13.0.1.0.0
87-
~~~~~~~~~~
91+
----------
8892

8993
First official version.
9094

@@ -94,36 +98,36 @@ Bug Tracker
9498
Bugs are tracked on `GitHub Issues <https://github.com/OCA/rest-framework/issues>`_.
9599
In case of trouble, please check there if your issue has already been reported.
96100
If you spotted it first, help us to smash it by providing a detailed and welcomed
97-
`feedback <https://github.com/OCA/rest-framework/issues/new?body=module:%20rest_log%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
101+
`feedback <https://github.com/OCA/rest-framework/issues/new?body=module:%20rest_log%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
98102

99103
Do not contact contributors directly about support or help with technical issues.
100104

101105
Credits
102106
=======
103107

104108
Authors
105-
~~~~~~~
109+
-------
106110

107111
* Camptocamp
108112
* ACSONE
109113

110114
Contributors
111-
~~~~~~~~~~~~
115+
------------
112116

113-
* Guewen Baconnier <[email protected]>
114-
* Simone Orsi <[email protected]>
117+
- Guewen Baconnier <[email protected]>
118+
- Simone Orsi <[email protected]>
115119

116120
Other credits
117-
~~~~~~~~~~~~~
121+
-------------
118122

119123
**Financial support**
120124

121-
* Cosanum
122-
* Camptocamp R&D
123-
* ACSONE R&D
125+
- Cosanum
126+
- Camptocamp R&D
127+
- ACSONE R&D
124128

125129
Maintainers
126-
~~~~~~~~~~~
130+
-----------
127131

128132
This module is maintained by the OCA.
129133

@@ -143,6 +147,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
143147

144148
|maintainer-simahawk|
145149

146-
This module is part of the `OCA/rest-framework <https://github.com/OCA/rest-framework/tree/16.0/rest_log>`_ project on GitHub.
150+
This module is part of the `OCA/rest-framework <https://github.com/OCA/rest-framework/tree/18.0/rest_log>`_ project on GitHub.
147151

148152
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

rest_log/exceptions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
class RESTServiceDispatchException(Exception):
8-
98
rest_json_info = {}
109

1110
def __init__(self, message, log_entry_url):

rest_log/models/rest_log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def _get_exception_severity_mapping(self):
8585
continue
8686
exc_name = severity = None
8787
try:
88-
exc_name, severity = [x.strip() for x in rule.split(":")]
88+
exc_name, severity = (x.strip() for x in rule.split(":"))
8989
if not exc_name or not severity:
9090
raise ValueError
9191
except ValueError:

rest_log/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
1-
Logs retention
2-
~~~~~~~~~~~~~~
1+
## Logs retention
32

4-
Logs are kept in database for every REST requests made by a client application.
5-
They can be used for debugging and monitoring of the activity.
3+
Logs are kept in database for every REST requests made by a client
4+
application. They can be used for debugging and monitoring of the
5+
activity.
66

7-
The Logs menu is shown only with Developer tools (``?debug=1``) activated.
7+
The Logs menu is shown only with Developer tools (`?debug=1`) activated.
88

9-
By default, REST logs are kept 30 days.
10-
You can change the duration of the retention by changing the System Parameter
11-
``rest.log.retention.days``.
9+
By default, REST logs are kept 30 days. You can change the duration of
10+
the retention by changing the System Parameter
11+
`rest.log.retention.days`.
1212

1313
If the value is set to 0, the logs are not stored at all.
1414

15-
Logged data is: request URL and method, parameters, headers, result or error.
15+
Logged data is: request URL and method, parameters, headers, result or
16+
error.
1617

17-
18-
Logs activation
19-
~~~~~~~~~~~~~~~
18+
## Logs activation
2019

2120
You have 2 ways to activate logging:
2221

23-
* on the service component set `_log_calls_in_db = True`
24-
* via configuration
22+
- on the service component set \_log_calls_in_db = True
23+
- via configuration
2524

2625
In the 1st case, calls will be always be logged.
2726

28-
In the 2nd case you can set ``rest.log.active`` param as::
27+
In the 2nd case you can set `rest.log.active` param as:
2928

3029
`collection_name` # enable for all endpoints of the collection
3130
`collection_name.usage` # enable for specific endpoints

rest_log/readme/CONTRIBUTORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Guewen Baconnier \<[email protected]\>
2+
- Simone Orsi \<[email protected]\>

rest_log/readme/CONTRIBUTORS.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

rest_log/readme/CREDITS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
**Financial support**
2+
3+
- Cosanum
4+
- Camptocamp R&D
5+
- ACSONE R&D

rest_log/readme/CREDITS.rst

Lines changed: 0 additions & 5 deletions
This file was deleted.

rest_log/readme/DESCRIPTION.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
When exposing REST services is often useful to see what's happening
2+
especially in case of errors.
3+
4+
This module add DB logging for REST requests. It also inject in the
5+
response the URL of the log entry created.
6+
7+
NOTE: this feature was implemented initially inside shopfloor app. Up to
8+
version 13.0.1.2.1 of this module, if shopfloor is installed, log
9+
records will be copied from its table.

0 commit comments

Comments
 (0)