__init__(self,
level,
translatable,
debug=None,
mid=None,
priority=50,
timestamp=None)
(Constructor)
| source code
|
Create a new message.
The mid identifies this kind of message, and serves two purposes.
The first purpose is to serve as a key by which a kind of message
might be removed from a set of messages. For example, a firewire
component detecting that a cable has been plugged in will remove any
message that the cable is unplugged.
Secondly it serves so that the message viewers that watch the 'current
state' of some object only see the latest message of a given type. For
example when messages are stored in persistent state objects that can be
transferred over the network, it becomes inefficient to store the whole
history of status messages. Message stores can keep only the latest
message of a given ID.
- Parameters:
level - ERROR, WARNING or INFO
translatable - a translatable possibly with markup for linking to documentation
or running commands.
debug - further, untranslated, debug information, not always shown
priority - priority compared to other messages of the same level
timestamp - time since epoch at which the message was generated, in seconds.
mid - A unique id for this kind of message, as discussed above. If not
given, will be generated from the contents of the translatable.
|