sanic.log.Colors#

Enum where members are also (and must be) strings

Inherits from: StrEnum, str, ReprEnum, Enum

class Colors(value, names = None, module = None, qualname = None, type = None, start = 1, boundary = None)

sanic.log.VerbosityFilter#

Filter instances are used to perform arbitrary filtering of LogRecords.

Inherits from: Filter

class VerbosityFilter(name = )

Loggers and Handlers can optionally use Filter instances to filter records as desired. The base filter class only allows events which are below a certain point in the logger hierarchy. For example, a filter initialized with "A.B" will allow events logged by loggers "A.B", "A.B.C", "A.B.C.D", "A.B.D" etc. but not "A.BB", "B.A.B" etc. If initialized with the empty string, all events are passed.

filter#

Determine if the specified record is to be logged.

def filter(self, record: <class 'logging.LogRecord'>): -> <class 'bool'>

Returns True if the record should be logged, or False otherwise. If deemed appropriate, the record may be modified in-place.

sanic.log.deprecation#

Add a deprecation notice

def deprecation(message: <class 'str'>, version: <class 'float'>)

Example when a feature is being removed. In this case, version should be AT LEAST next version + 2

deprecation(&quot;Helpful message&quot;, 99.9)

Example when a feature is deprecated but not being removed:

deprecation(&quot;Helpful message&quot;, 0)
Parameters
message
str

The message of the notice

version
float

The version when the feature will be removed. If it is not being removed, then set version=0.