<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def logMsg(self, msg, printMsg=True):
 """ logs a message and prints it to the screen """

        time = datetime.datetime.now().strftime('%I:%M %p')
        self.log = '{0}\n{1} | {2}'.format(self.log, time, msg)
        if printMsg:
            print msg

        if self.addLogsToArcpyMessages:
            from arcpy import AddMessage
            AddMessage(msg)