modules.console#

class modules.console.Console(context)#

Bases: object

class Entry#

Bases: TypedDict

message: str#
traceback: None#
type_id: int#
class Type_(*values)#

Bases: IntEnum

error = 1#
none = 0#
note = 3#
warning = 2#
__init__(context) None#

Console manager

Parameters:

context (EmberEngine) – This is the main context of the application

clear()#

Clear the console entries buffer

error(message: str) None#
error(message: str, stack: list[str]) None

Wrapper method to add error entry

getEntries() List[Entry]#

Get console entries buffer

Returns:

A reference to the entries buffer

Return type:

List[Entry]

get_entry_color(entry: Entry) None#

Get the color of a given entry

log(message: str) None#
log(message: str, log_type: Type_) None
log(message: str, log_type: Type_, stack: list[str]) None

Add entry to the console entries buffer

Parameters:
  • log_type (Console.Type_) – The type of a entry, Type_.error Type_.warning, or Type_.note

  • stack (List[str]) – A list that contains detailed information of a raised Exception

  • message (str) – The message of the entry

note(message: str) None#

Wrapper method to add note entry

warn(message: str) None#

Wrapper method to add warning entry