• Scott Kuhl's avatar
    Refactor debug, log and Fatal messages. · 7fc33c00
    Scott Kuhl authored
    This commit rewrites the log() function so that it will append a
    newline at the end of the message if none is present. It doesn't make
    sense to print a log message without a newline since the next log
    message (which will write a prefix) expects to be starting at the
    beginning of a line.
    
    Although it isn't strictly necessary, this commit also removes any
    newlines at the ends of messages. If I missed any, including the
    newline at the end of the message will continue to work as it did
    before.
    
    Previously, some calls were missing the newline at the end even though
    including it was necessary for subsequent messages to appear
    correctly.
    
    This code also cleans up some redundant prefixes. The log() method
    will prepend the prefix and the different processes should set their
    prefix as soon as they start.
    
    Multiline messages are still supported (although the prefix for the
    additional lines was changed to match the length of the prefix used
    for the first line).
    7fc33c00
hostwatch.py 7.62 KB