'Write log by print() or logger'

def write_log(self, log_text):

    if (self.log_mod == 0):
        try:
            print log_text
        except UnicodeEncodeError:
            print 'Your    text    has    unicode    problem!'
    elif (self.log_mod == 1):
        if (self.log_file == 0):
            self.log_file = 1
            now_time = datetime.datetime.now()
            self.log_full_path = ('%s%s_%s.log' % (self.log_file_path, self.user_login, now_time.strftime('%d.%m.%Y_%H:%M')))
            formatter = logging.Formatter('%(asctime)s    -    %(name)s    -    %(message)s')
            self.logger = logging.getLogger(self.user_login)
            self.hdrl = logging.FileHandler(self.log_full_path, mode='w')
            self.hdrl.setFormatter(formatter)
            self.logger.setLevel(level=logging.INFO)
            self.logger.addHandler(self.hdrl)
        try:
            self.logger.info(log_text)
        except UnicodeEncodeError:
            print 'Your    text    has    unicode    problem!'
