File size: 720 Bytes
246df79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from datetime import datetime


class logger():
    """
    A  wrapper class around the Python print function used to only print
    """
    DEBUG = False

    @staticmethod
    def print_message(message, logging_level=0):
        """
        A  wrapper function around the Python print function used to only print
        :param message: the message to print
        :param override_debug: a boolean on if the DEBUG status should be override. if True a log will be printed,
        irrespective of if in Debug mode.
        """
        if logging_level >= 1 or logger.DEBUG:
            now = datetime.now()
            current_time = now.strftime("%H:%M:%S")
            print("{} | {}".format(current_time, message))