nanome.util.logs module

class Logs[source]

Bases: object

Allows for easy message logging without buffer issues.
Possible log types are Debug, Warning, and Error.
class LogType[source]

Bases: enum.IntEnum

An enumeration.

debug = 1
error = 3
info = 4
warning = 2
static caller_name(skip=2)[source]

Get a name of a caller in the format module.class.method

skip specifies how many levels of stack to skip while getting caller name. skip=1 means “who calls me”, skip=2 “who calls my caller” etc.

An empty string is returned if skipped levels exceed stack height

https://stackoverflow.com/questions/2654113/how-to-get-the-callers-method-name-in-the-called-method

classmethod debug(*args, **kwargs)[source]
Prints a debug message.
Prints only if plugin started in verbose mode (with -v argument)
Parameters:
  • args (Anything printable) – Variable length argument list
  • kwargs – Keyword arguments to pass to python logging module.

For options, see https://github.com/python/cpython/blob/main/Lib/logging/__init__.py#L1604

static deprecated(new_func=None, msg='')[source]
classmethod error(*args, **kwargs)[source]
Prints an error.
Parameters:
  • args (Anything printable) – Variable length argument list
  • kwargs – Keyword arguments to pass to python logging module.

For options, see https://github.com/python/cpython/blob/main/Lib/logging/__init__.py#L1604

classmethod message(*args, **kwargs)[source]
Prints a message.
Parameters:
  • args (Anything printable) – Variable length argument list
  • kwargs – Keyword arguments to pass to python logging module.

For options, see https://github.com/python/cpython/blob/main/Lib/logging/__init__.py#L1604

classmethod warning(*args, **kwargs)[source]
Prints a warning.
Parameters:
  • args (Anything printable) – Variable length argument list
  • kwargs – Keyword arguments to pass to python logging module.

For options, see https://github.com/python/cpython/blob/main/Lib/logging/__init__.py#L1604