Skip to content

Commit

Permalink
renaming public api check
Browse files Browse the repository at this point in the history
  • Loading branch information
emdneto committed May 31, 2024
1 parent b656188 commit 0315622
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions opentelemetry-api/src/opentelemetry/attributes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,32 +126,32 @@ def _clean_attribute_value(
return value


class Once:
def __init__(self):
# self._lock = threading.Lock()
self._run = False
# class _Once:
# def __init__(self):
# # self._lock = threading.Lock()
# self._run = False

def __call__(self, func):
def wrapper(*args, **kwargs):
# with self._lock:
if not self._run:
self._run = True
return func(*args, **kwargs)
# def __call__(self, func):
# def wrapper(*args, **kwargs):
# # with self._lock:
# if not self._run:
# self._run = True
# return func(*args, **kwargs)

return wrapper
# return wrapper


class SDKLogger:
class _InternalLogger:
def __enter__(self):
_logger.propagate = False

def __exit__(self, exit_type, exit_value, exit_traceback):
_logger.propagate = True


@Once()
# @_Once()
def _log_dropped_attributes_warning(msg: str) -> None:
with SDKLogger():
with _InternalLogger():
_logger.warning(msg)


Expand Down

0 comments on commit 0315622

Please sign in to comment.