azpaddypy 0.2.3__py3-none-any.whl → 0.2.5__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.
azpaddypy/mgmt/logging.py CHANGED
@@ -35,7 +35,6 @@ class AzureLogger:
35
35
  log_level: int = logging.INFO,
36
36
  enable_console_logging: bool = True,
37
37
  custom_resource_attributes: Optional[Dict[str, str]] = None,
38
- clean_legacy_logging: bool = True,
39
38
  ):
40
39
  """
41
40
  Initialize the Azure Logger with OpenTelemetry tracing
@@ -47,20 +46,7 @@ class AzureLogger:
47
46
  log_level: Logging level (default: INFO)
48
47
  enable_console_logging: Enable console output for local development
49
48
  custom_resource_attributes: Additional resource attributes
50
- clean_legacy_logging: A flag to clean up legacy logging providers.
51
49
  """
52
- if clean_legacy_logging:
53
- # cleaning stale loggers
54
- logger_provider = get_logger_provider()
55
- if logger_provider:
56
- logger_provider.shutdown()
57
- tracer_provider = get_tracer_provider()
58
- if tracer_provider:
59
- tracer_provider.shutdown()
60
- meter_provider = get_meter_provider()
61
- if meter_provider:
62
- meter_provider.shutdown()
63
-
64
50
  self.service_name = service_name
65
51
  self.service_version = service_version
66
52
  self.connection_string = connection_string or os.getenv(
@@ -217,7 +203,7 @@ class AzureLogger:
217
203
  if baggage_items:
218
204
  enhanced_extra["baggage"] = baggage_items
219
205
 
220
- if extra:
206
+ if isinstance(extra, dict):
221
207
  enhanced_extra.update(extra)
222
208
 
223
209
  return enhanced_extra
@@ -654,7 +640,6 @@ def create_app_logger(
654
640
  log_level: int = logging.INFO,
655
641
  enable_console_logging: bool = True,
656
642
  custom_resource_attributes: Optional[Dict[str, str]] = None,
657
- clean_legacy_logging: bool = True,
658
643
  ) -> AzureLogger:
659
644
  """
660
645
  Factory function to create an AzureLogger instance. If a logger with the
@@ -667,7 +652,6 @@ def create_app_logger(
667
652
  log_level: Logging level
668
653
  enable_console_logging: Enable console output
669
654
  custom_resource_attributes: Additional resource attributes
670
- clean_legacy_logging: Whether to clean up legacy logging providers.
671
655
 
672
656
  Returns:
673
657
  Configured AzureLogger instance
@@ -689,7 +673,6 @@ def create_app_logger(
689
673
  log_level,
690
674
  enable_console_logging,
691
675
  attr_items,
692
- clean_legacy_logging,
693
676
  )
694
677
 
695
678
  if params_key in _loggers:
@@ -702,7 +685,6 @@ def create_app_logger(
702
685
  log_level=log_level,
703
686
  enable_console_logging=enable_console_logging,
704
687
  custom_resource_attributes=custom_resource_attributes,
705
- clean_legacy_logging=clean_legacy_logging,
706
688
  )
707
689
  _loggers[params_key] = logger
708
690
  return logger
@@ -713,7 +695,6 @@ def create_function_logger(
713
695
  function_name: str,
714
696
  service_version: str = "1.0.0",
715
697
  connection_string: Optional[str] = None,
716
- clean_legacy_logging: bool = True,
717
698
  ) -> AzureLogger:
718
699
  """
719
700
  Factory function specifically for Azure Functions
@@ -738,5 +719,4 @@ def create_function_logger(
738
719
  service_version=service_version,
739
720
  connection_string=connection_string,
740
721
  custom_resource_attributes=custom_attributes,
741
- clean_legacy_logging=clean_legacy_logging,
742
722
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: azpaddypy
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: Comprehensive Python logger for Azure, integrating OpenTelemetry for advanced, structured, and distributed tracing.
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -0,0 +1,9 @@
1
+ azpaddypy/mgmt/__init__.py,sha256=5-0eZuJMZlCONZNJ5hEvWXfvLIM36mg7FsEVs32bY_A,183
2
+ azpaddypy/mgmt/logging.py,sha256=7Ug99lg8gsvCGq0HukR0qWVl-_vacEq-poq2rUj24d4,26060
3
+ azpaddypy/test_function/__init__.py,sha256=0NjUl36wvUWV79GpRwBFkgkBaC6uDZsTdaSVOIHMFEU,3481
4
+ azpaddypy/test_function/function_app.py,sha256=6nX54-iq0L1l_hZpD6E744-j79oLxdaldFyWDCpwH7c,3867
5
+ azpaddypy-0.2.5.dist-info/licenses/LICENSE,sha256=hQ6t0g2QaewGCQICHqTckBFbMVakGmoyTAzDpmEYV4c,1089
6
+ azpaddypy-0.2.5.dist-info/METADATA,sha256=jRpU4IdaoGDvndVSIwH8__6Fev35Lq6XubUty9NKuFU,799
7
+ azpaddypy-0.2.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
+ azpaddypy-0.2.5.dist-info/top_level.txt,sha256=hsDuboDhT61320ML8X479ezSTwT3rrlDWz1_Z45B2cs,10
9
+ azpaddypy-0.2.5.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- azpaddypy/mgmt/__init__.py,sha256=5-0eZuJMZlCONZNJ5hEvWXfvLIM36mg7FsEVs32bY_A,183
2
- azpaddypy/mgmt/logging.py,sha256=LI7pvMuiUbT-RoW5wImyWxZTzexxvA6IDSD4RVyxCkg,26918
3
- azpaddypy/test_function/__init__.py,sha256=0NjUl36wvUWV79GpRwBFkgkBaC6uDZsTdaSVOIHMFEU,3481
4
- azpaddypy/test_function/function_app.py,sha256=6nX54-iq0L1l_hZpD6E744-j79oLxdaldFyWDCpwH7c,3867
5
- azpaddypy-0.2.3.dist-info/licenses/LICENSE,sha256=hQ6t0g2QaewGCQICHqTckBFbMVakGmoyTAzDpmEYV4c,1089
6
- azpaddypy-0.2.3.dist-info/METADATA,sha256=vEWDGAtY5Cxvz3qLRA9fJEeUjFObLaElceLsZGsyDi0,799
7
- azpaddypy-0.2.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
- azpaddypy-0.2.3.dist-info/top_level.txt,sha256=hsDuboDhT61320ML8X479ezSTwT3rrlDWz1_Z45B2cs,10
9
- azpaddypy-0.2.3.dist-info/RECORD,,