c2cwsgiutils 6.1.6.dev7__py3-none-any.whl → 6.1.6.dev10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
c2cwsgiutils/loader.py CHANGED
@@ -3,7 +3,7 @@ from typing import Optional, cast
3
3
 
4
4
  from plaster_pastedeploy import Loader as BaseLoader
5
5
 
6
- from c2cwsgiutils import get_config_defaults
6
+ from c2cwsgiutils import get_config_defaults, get_logconfig_dict
7
7
 
8
8
  _LOG = logging.getLogger(__name__)
9
9
 
@@ -19,3 +19,22 @@ class Loader(BaseLoader): # type: ignore
19
19
  def __repr__(self) -> str:
20
20
  """Get the object representation."""
21
21
  return f'c2cwsgiutils.loader.Loader(uri="{self.uri}")'
22
+
23
+ def setup_logging(self, defaults: Optional[dict[str, str]] = None) -> None:
24
+ """
25
+ Set up logging via :func:`logging.config.dictConfig` with value returned from c2cwsgiutils.get_logconfig_dict.
26
+
27
+ Defaults are specified for the special ``__file__`` and ``here``
28
+ variables, similar to PasteDeploy config loading. Extra defaults can
29
+ optionally be specified as a dict in ``defaults``.
30
+
31
+ Arguments:
32
+ ---------
33
+ defaults: The defaults that will be used when passed to
34
+ :func:`logging.config.fileConfig`.
35
+
36
+ """
37
+ if "loggers" in self.get_sections():
38
+ logging.config.dictConfig(get_logconfig_dict(self.uri.path))
39
+ else:
40
+ logging.basicConfig()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: c2cwsgiutils
3
- Version: 6.1.6.dev7
3
+ Version: 6.1.6.dev10
4
4
  Summary: Common utilities for Camptocamp WSGI applications
5
5
  Home-page: https://github.com/camptocamp/c2cwsgiutils
6
6
  License: BSD-2-Clause
@@ -25,7 +25,7 @@ c2cwsgiutils/debug/utils.py,sha256=sIKZHQ8empzxE2OI3h7Uce8cvv4O7AD1y_VYeZfLVCA,2
25
25
  c2cwsgiutils/errors.py,sha256=-hWLQ1qDlh9kn06-33U2c39BbOxuCvJIkBkdxriE5mo,6644
26
26
  c2cwsgiutils/health_check.py,sha256=OhfPcApBht1qtBOX8e8pdeq3QwF4FbgGkofjqpl8GvQ,20068
27
27
  c2cwsgiutils/index.py,sha256=zQTp2dlb50DZy0TZOPYDxJv84kivcYirswz7rFMbSDA,17988
28
- c2cwsgiutils/loader.py,sha256=vU7yEobl9TlSFZwdLI2eF1ceUJ6xgiu2re31HA5sw1g,623
28
+ c2cwsgiutils/loader.py,sha256=aDs_YOoiEc_vr94fnc3TjUklIGgIOBZdoYLAjQHgTpo,1393
29
29
  c2cwsgiutils/logging_view.py,sha256=d0UkvYRGkVUMY9_vbjEzXmm8-6CCec2B43a3mJAqWyw,3370
30
30
  c2cwsgiutils/models_graph.py,sha256=q5dW_gZ5iUZCzBya5Kpy57y9oqsG-rGi9AvrXCDgYqs,2679
31
31
  c2cwsgiutils/pretty_json.py,sha256=WQlgNVeWPD_QMEjkNq5rFVGdFwQ7xDyICf0uxj0Hu2U,1697
@@ -60,8 +60,8 @@ c2cwsgiutils/stats_pyramid/_db_spy.py,sha256=A61t6VKIrRRIjbyZTldmAUl_Q3ZDVFYqyxj
60
60
  c2cwsgiutils/stats_pyramid/_pyramid_spy.py,sha256=mRiOmQXV9x8JjkGV4MsaC7sD3qO6dWUTog0bharLLD0,3517
61
61
  c2cwsgiutils/templates/index.html.mako,sha256=cK8qGBDeQG5SiJJCfvL0oKpgacr7dPKx634AAQivmjA,1416
62
62
  c2cwsgiutils/version.py,sha256=1ghPu-aKMJdfCSUrxgBENNqNQ-7JMKJr6tS14dDmW4Q,3110
63
- c2cwsgiutils-6.1.6.dev7.dist-info/LICENSE,sha256=6bEOU0n7ued3SA-DQCsHQaACONMMRzGHmH5XhDVeD-U,1304
64
- c2cwsgiutils-6.1.6.dev7.dist-info/METADATA,sha256=c9wbcQ68M3rjOOBZyyg2ls07frnE8TG5ceTwii6nlR4,34401
65
- c2cwsgiutils-6.1.6.dev7.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
66
- c2cwsgiutils-6.1.6.dev7.dist-info/entry_points.txt,sha256=ujgqMTL1awN9qDg8WXmrF7m0fgR-hslUM6zKH86pvy0,703
67
- c2cwsgiutils-6.1.6.dev7.dist-info/RECORD,,
63
+ c2cwsgiutils-6.1.6.dev10.dist-info/LICENSE,sha256=6bEOU0n7ued3SA-DQCsHQaACONMMRzGHmH5XhDVeD-U,1304
64
+ c2cwsgiutils-6.1.6.dev10.dist-info/METADATA,sha256=oSwZ9AoPoISe8AZJzEUrs_of8v8egy0w1yz53qdPF68,34402
65
+ c2cwsgiutils-6.1.6.dev10.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
66
+ c2cwsgiutils-6.1.6.dev10.dist-info/entry_points.txt,sha256=ujgqMTL1awN9qDg8WXmrF7m0fgR-hslUM6zKH86pvy0,703
67
+ c2cwsgiutils-6.1.6.dev10.dist-info/RECORD,,