コード例 #1
0
ファイル: setup.py プロジェクト: nicholasmhughes/salt
 def wrapper(*args, **kwargs):
     warn_until_date(
         "20240101",
         "Please stop using 'salt.log.setup.{name}()' as it no longer does anything and "
         "will go away after {{date}}.".format(name=func.__qualname__),
         stacklevel=4,
     )
コード例 #2
0
ファイル: handlers.py プロジェクト: nicholasmhughes/salt
 def __init__(self, level=logging.NOTSET, max_queue_size=10000):
     warn_until_date(
         "20240101",
         "Please stop using '{name}.TemporaryLoggingHandler'. "
         "'{name}.TemporaryLoggingHandler' will go away after "
         "{{date}}.".format(name=__name__),
     )
     super().__init__(level=level)
     self.__messages = deque(maxlen=max_queue_size)
コード例 #3
0
ファイル: handlers.py プロジェクト: nicholasmhughes/salt
 def __init__(self, queue):  # pylint: disable=useless-super-delegation
     super().__init__(queue)
     warn_until_date(
         "20240101",
         "Please stop using '{name}.QueueHandler' and instead "
         "use 'logging.handlers.QueueHandler'. "
         "'{name}.QueueHandler' will go away after "
         "{{date}}.".format(name=__name__),
     )
コード例 #4
0
ファイル: test_process.py プロジェクト: crimv42/saltstack
 def _patched_warn_until_date(date,
                              message,
                              category=DeprecationWarning,
                              stacklevel=None,
                              _current_date=current_date,
                              _dont_call_warnings=False):
     # Because we add another function in between, the stacklevel
     # set in salt.utils.process, 3, needs to now be 4
     stacklevel = 4
     return warn_until_date(date,
                            message,
                            category=category,
                            stacklevel=stacklevel,
                            _current_date=_current_date,
                            _dont_call_warnings=_dont_call_warnings)
コード例 #5
0
ファイル: __init__.py プロジェクト: nicholasmhughes/salt
import logging

from salt._logging.handlers import (
    FileHandler,
    QueueHandler,
    RotatingFileHandler,
    StreamHandler,
    SysLogHandler,
    TemporaryLoggingHandler,
    WatchedFileHandler,
)
from salt.utils.versions import warn_until_date

warn_until_date(
    "20240101",
    "Please stop using '{name}' and instead use 'salt._logging.handlers'. "
    "'{name}' will go away after {{date}}.".format(name=__name__),
)

NullHandler = logging.NullHandler
コード例 #6
0
ファイル: setup.py プロジェクト: nicholasmhughes/salt
)
from salt._logging.impl import (
    LOG_COLORS,
    LOG_LEVELS,
    LOG_VALUES_TO_LEVELS,
    SORTED_LEVEL_NAMES,
    SaltColorLogRecord,
    SaltLogRecord,
)
from salt._logging.impl import set_log_record_factory as setLogRecordFactory
from salt.utils.versions import warn_until_date

warn_until_date(
    "20240101",
    "Please stop using '{name}' and instead use 'salt._logging'. "
    "'{name}' will go away after {{date}}. Do note however that "
    "'salt._logging' is now considered a non public implementation "
    "and is subject to change without deprecations.".format(name=__name__),
    stacklevel=4,
)


def _deprecated_warning(func):
    @wraps(func)
    def wrapper(*args, **kwargs):
        warn_until_date(
            "20240101",
            "Please stop using 'salt.log.setup.{name}()' as it no longer does anything and "
            "will go away after {{date}}.".format(name=func.__qualname__),
            stacklevel=4,
        )