mcfacts.objects.log.LogFunction

class mcfacts.objects.log.LogFunction(*args, **kwargs)

Bases: Protocol

A protocol that represents a logging function.

Any callable that matches this protocol should accept a message as a string and an optional new_line flag (defaulting to True), and return None.

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

__call__(msg: str, new_line: bool = True, /) None

Log a message, optionally appending a new line.

Parameters:
  • msg (str) – The message to be logged.

  • new_line (bool, optional) – Whether to append a newline after the message. Defaults to True.