def __init__(self, level, message, message_id, timestamp=None, now_reference=None):
        """Constructor.

        Args:
            level (int): The message importance
            message (string): The message contents
            message_id (int): A unique id for the message
            timestamp (float): An optional monotonic value in seconds for when the message was created
            now_reference (float): If timestamp is not relative to monotonic() as called from this
                module then this should be now() as seen by whoever created the timestamp.
        """

        self.level = level
        self.message = message
        self.count = 1
        self.id = message_id

        if timestamp is None:
            self.created = monotonic()
        elif now_reference is None:
            self.created = timestamp
        else:
            # Figure out the age of the timestamp relative to the now reference from the creator
            # and subtract that age from now for us to convert the timestamp into our frame of
            # reference.
            now = monotonic()
            adj = now - now_reference
            self.created = timestamp + adj

            # Make sure we never create times in the future so that age below is always nonnegative
            if self.created > now:
                self.created = now
def __init__ ( self , level , message , message_id , timestamp = None , now_reference = None ) : self . level = level self . message = message self . count = 1 self . id = message_id if timestamp is None : self . created = monotonic ( ) elif now_reference is None : self . created = timestamp else : now = monotonic ( ) adj = now - now_reference self . created = timestamp + adj if self . created > now : self . created = now
Constructor.

        Args:
            level (int): The message importance
            message (string): The message contents
            message_id (int): A unique id for the message
            timestamp (float): An optional monotonic value in seconds for when the message was created
            now_reference (float): If timestamp is not relative to monotonic() as called from this
                module then this should be now() as seen by whoever created the timestamp.