Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CE-311 - logging everywhere #49

Merged
merged 5 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,70 +264,70 @@ alphabetically, which is fine for looking them up, but not for their relationshi
<a name="header_type__errorresponse_authorizationrequirederror_"></a>
##### _ErrorResponse_AuthorizationRequiredError_

<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td>!! NOT HANDLED !!</td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>error</td><td><a href="#user-content-header_type_authorizationrequirederror">AuthorizationRequiredError</a></td><td>✓</td></tr></tbody></table>
<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td><div><i>Const</i></div><table><tr><th>const</th><td>2.0</td></tr><tr><th>title</th><td>Jsonrpc</td></tr><tr><th>default</th><td>2.0</td></tr><tr><th>example</th><td>2.0</td></tr></table></td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>error</td><td><a href="#user-content-header_type_authorizationrequirederror">AuthorizationRequiredError</a></td><td>✓</td></tr></tbody></table>



<a name="header_type__errorresponse_internalerror_"></a>
##### _ErrorResponse_InternalError_

<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td>!! NOT HANDLED !!</td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>error</td><td><a href="#user-content-header_type_internalerror">InternalError</a></td><td>✓</td></tr></tbody></table>
<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td><div><i>Const</i></div><table><tr><th>const</th><td>2.0</td></tr><tr><th>title</th><td>Jsonrpc</td></tr><tr><th>default</th><td>2.0</td></tr><tr><th>example</th><td>2.0</td></tr></table></td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>error</td><td><a href="#user-content-header_type_internalerror">InternalError</a></td><td>✓</td></tr></tbody></table>



<a name="header_type__errorresponse_invalidparams_"></a>
##### _ErrorResponse_InvalidParams_

<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td>!! NOT HANDLED !!</td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>error</td><td><a href="#user-content-header_type_invalidparams">InvalidParams</a></td><td>✓</td></tr></tbody></table>
<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td><div><i>Const</i></div><table><tr><th>const</th><td>2.0</td></tr><tr><th>title</th><td>Jsonrpc</td></tr><tr><th>default</th><td>2.0</td></tr><tr><th>example</th><td>2.0</td></tr></table></td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>error</td><td><a href="#user-content-header_type_invalidparams">InvalidParams</a></td><td>✓</td></tr></tbody></table>



<a name="header_type__errorresponse_invalidrequest_"></a>
##### _ErrorResponse_InvalidRequest_

<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td>!! NOT HANDLED !!</td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>error</td><td><a href="#user-content-header_type_invalidrequest">InvalidRequest</a></td><td>✓</td></tr></tbody></table>
<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td><div><i>Const</i></div><table><tr><th>const</th><td>2.0</td></tr><tr><th>title</th><td>Jsonrpc</td></tr><tr><th>default</th><td>2.0</td></tr><tr><th>example</th><td>2.0</td></tr></table></td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>error</td><td><a href="#user-content-header_type_invalidrequest">InvalidRequest</a></td><td>✓</td></tr></tbody></table>



<a name="header_type__errorresponse_methodnotfound_"></a>
##### _ErrorResponse_MethodNotFound_

<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td>!! NOT HANDLED !!</td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>error</td><td><a href="#user-content-header_type_methodnotfound">MethodNotFound</a></td><td>✓</td></tr></tbody></table>
<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td><div><i>Const</i></div><table><tr><th>const</th><td>2.0</td></tr><tr><th>title</th><td>Jsonrpc</td></tr><tr><th>default</th><td>2.0</td></tr><tr><th>example</th><td>2.0</td></tr></table></td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>error</td><td><a href="#user-content-header_type_methodnotfound">MethodNotFound</a></td><td>✓</td></tr></tbody></table>



<a name="header_type__errorresponse_notauthorizederror_"></a>
##### _ErrorResponse_NotAuthorizedError_

<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td>!! NOT HANDLED !!</td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>error</td><td><a href="#user-content-header_type_notauthorizederror">NotAuthorizedError</a></td><td>✓</td></tr></tbody></table>
<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td><div><i>Const</i></div><table><tr><th>const</th><td>2.0</td></tr><tr><th>title</th><td>Jsonrpc</td></tr><tr><th>default</th><td>2.0</td></tr><tr><th>example</th><td>2.0</td></tr></table></td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>error</td><td><a href="#user-content-header_type_notauthorizederror">NotAuthorizedError</a></td><td>✓</td></tr></tbody></table>



<a name="header_type__errorresponse_notfounderror_"></a>
##### _ErrorResponse_NotFoundError_

<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td>!! NOT HANDLED !!</td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>error</td><td><a href="#user-content-header_type_notfounderror">NotFoundError</a></td><td>✓</td></tr></tbody></table>
<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td><div><i>Const</i></div><table><tr><th>const</th><td>2.0</td></tr><tr><th>title</th><td>Jsonrpc</td></tr><tr><th>default</th><td>2.0</td></tr><tr><th>example</th><td>2.0</td></tr></table></td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>error</td><td><a href="#user-content-header_type_notfounderror">NotFoundError</a></td><td>✓</td></tr></tbody></table>



<a name="header_type__errorresponse_parseerror_"></a>
##### _ErrorResponse_ParseError_

<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td>!! NOT HANDLED !!</td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>error</td><td><a href="#user-content-header_type_parseerror">ParseError</a></td><td>✓</td></tr></tbody></table>
<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td><div><i>Const</i></div><table><tr><th>const</th><td>2.0</td></tr><tr><th>title</th><td>Jsonrpc</td></tr><tr><th>default</th><td>2.0</td></tr><tr><th>example</th><td>2.0</td></tr></table></td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>error</td><td><a href="#user-content-header_type_parseerror">ParseError</a></td><td>✓</td></tr></tbody></table>



<a name="header_type__request"></a>
##### _Request

<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td>!! NOT HANDLED !!</td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>method</td><td>string</td><td>✓</td></tr><tr><td>params</td><td>object</td><td></td></tr></tbody></table>
<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td><div><i>Const</i></div><table><tr><th>const</th><td>2.0</td></tr><tr><th>title</th><td>Jsonrpc</td></tr><tr><th>default</th><td>2.0</td></tr><tr><th>example</th><td>2.0</td></tr></table></td><td></td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td></td></tr><tr><td>method</td><td>string</td><td>✓</td></tr><tr><td>params</td><td>object</td><td></td></tr></tbody></table>



<a name="header_type__response"></a>
##### _Response

<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td>!! NOT HANDLED !!</td><td>✓</td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td>✓</td></tr><tr><td>result</td><td>object</td><td>✓</td></tr></tbody></table>
<table><thead><tr><th colspan="3"><img width="2000px"></th></tr><tr><th><img width="1000px"></th><th><img width="200px"></th><th><img width="75px"></th><tr><th>Name</th><th>Type</th><th>Required</th></tr></thead><tbody><tr><td>jsonrpc</td><td><div><i>Const</i></div><table><tr><th>const</th><td>2.0</td></tr><tr><th>title</th><td>Jsonrpc</td></tr><tr><th>default</th><td>2.0</td></tr><tr><th>example</th><td>2.0</td></tr></table></td><td>✓</td></tr><tr><td>id</td><td><div><i>Any Of</i></div><div>string</div><div>integer</div></td><td>✓</td></tr><tr><td>result</td><td>object</td><td>✓</td></tr></tbody></table>



Expand Down
4 changes: 2 additions & 2 deletions log_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ loggers:
handlers:
- json
propagate: no
orcidlinkapi:
orcidapi:
level: DEBUG
filters: [correlation_id]
handlers:
- json
propagate: no
orcidlinkoauth:
orcidoauthapi:
level: DEBUG
filters: [correlation_id]
handlers:
Expand Down
13 changes: 13 additions & 0 deletions src/misc/generate-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ def md_tags(tags):
return f'tags: {", ".join(tags)}'


def generate_rotated_table(table_data: dict[str, str]) -> str:
result = "<table>"
for k, v in table_data.items():
result += f"<tr><th>{k}</th><td>{v}</td></tr>"
result += "</table>"
return result


def generate_schema(schema):
if "$ref" in schema:
link = schema["$ref"]
Expand All @@ -248,6 +256,11 @@ def generate_schema(schema):
for all_of in schema["allOf"]:
html += f"<div>{generate_schema(all_of)}</div>"
return html
elif "const" in schema:
html = "<div><i>Const</i></div>"
html += generate_rotated_table(schema)
# html += f'<table><span>{schema["title"]}</span><span>{schema["const"]}</div>'
return html
else:
print("NOT HANDLED", schema)
return "!! NOT HANDLED !!"
Expand Down
Loading