parameters: (self, tag, message, color=None)
docstring: Prints a message to the console and log with timestamp and tag information.
docstring_summary: Prints a message to the console and log with timestamp and tag information.
docstring_tokens: Prints a message to the console and log with timestamp and tag information .
function: def _print_message(self, tag, message, color=None):
          """
          Prints a message to the console and log with timestamp and tag information.
          """
  
          # convert to time-stamped message
          dt = self.total_time_str()
          tag = tag.rjust(5)
          message = f'{dt} {tag} | {message}'
  
          # write to log file
          if self.log:
              with open(self.log, 'a') as file:
                  file.write(message + '\n')
  
          # colorize when writing to console
          if color is not None:
              color_func = getattr(fs.utils.term, color)
              message = color_func(message)
          print(message)
function_tokens: def _print_message ( self , tag , message , color = None ) : # convert to time-stamped message dt = self . total_time_str ( ) tag = tag . rjust ( 5 ) message = f'{dt} {tag} | {message}' # write to log file if self . log : with open ( self . log , 'a' ) as file : file . write ( message + '\n' ) # colorize when writing to console if color is not None : color_func = getattr ( fs . utils . term , color ) message = color_func ( message ) print ( message )