Esempio n. 1
0
 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,
     )
Esempio n. 2
0
 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)
Esempio n. 3
0
 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__),
     )
Esempio n. 4
0
 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)
Esempio n. 5
0
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
Esempio n. 6
0
)
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,
        )