import logging
from logging.handlers import TimedRotatingFileHandler

class PriestLogger:

	def __init__(self):
		logHandler = TimedRotatingFileHandler("C:\\lucas\\PriestPy\\Dropbox\\logs\\HowToPriest",when="midnight",backupCount=365)
		logFormatter = logging.Formatter('%(asctime)s - %(message)s')
		logHandler.setFormatter( logFormatter )
		self.logger = logging.getLogger( 'H2PLogger' )
		self.logger.addHandler( logHandler )
		self.logger.setLevel( logging.INFO )
	
	def log(self, message):
		self.logger.info(message.channel.name + ' - ' + message.author.name+': ' + message.content)
import logging
from logging.handlers import TimedRotatingFileHandler
from time import sleep

class PriestLogger:

	def __init__(self):
		logHandler = TimedRotatingFileHandler("C:\\lucas\\PriestPy\\Dropbox\\logs\\HowToPriest",when="midnight",backupCount=365)
		logFormatter = logging.Formatter('%(asctime)s - %(message)s')
		logHandler.setFormatter( logFormatter )
		self.logger = logging.getLogger( 'H2PLogger' )
		self.logger.addHandler( logHandler )
		self.logger.setLevel( logging.INFO )
	
	def log(self, message):
		sent = false
		while not sent:
			try:
				self.logger.info(message.channel.name + ' - ' + message.author.name+': ' + message.content)
				sent = true
			except:
				sleep(0.2)
			
Fix for conflict in opening file
Fix for conflict in opening file

  import logging
  from logging.handlers import TimedRotatingFileHandler
+ from time import sleep
  
  class PriestLogger:
  
  	def __init__(self):
  		logHandler = TimedRotatingFileHandler("C:\\lucas\\PriestPy\\Dropbox\\logs\\HowToPriest",when="midnight",backupCount=365)
  		logFormatter = logging.Formatter('%(asctime)s - %(message)s')
  		logHandler.setFormatter( logFormatter )
  		self.logger = logging.getLogger( 'H2PLogger' )
  		self.logger.addHandler( logHandler )
  		self.logger.setLevel( logging.INFO )
  	
  	def log(self, message):
+ 		sent = false
+ 		while not sent:
+ 			try:
- 		self.logger.info(message.channel.name + ' - ' + message.author.name+': ' + message.content)
+ 				self.logger.info(message.channel.name + ' - ' + message.author.name+': ' + message.content)
+ 				sent = true
+ 			except:
+ 				sleep(0.2)
+ 			
Fix for conflict in opening file
## Code Before:
import logging
from logging.handlers import TimedRotatingFileHandler

class PriestLogger:

	def __init__(self):
		logHandler = TimedRotatingFileHandler("C:\\lucas\\PriestPy\\Dropbox\\logs\\HowToPriest",when="midnight",backupCount=365)
		logFormatter = logging.Formatter('%(asctime)s - %(message)s')
		logHandler.setFormatter( logFormatter )
		self.logger = logging.getLogger( 'H2PLogger' )
		self.logger.addHandler( logHandler )
		self.logger.setLevel( logging.INFO )
	
	def log(self, message):
		self.logger.info(message.channel.name + ' - ' + message.author.name+': ' + message.content)
## Instruction:
Fix for conflict in opening file
## Code After:
import logging
from logging.handlers import TimedRotatingFileHandler
from time import sleep

class PriestLogger:

	def __init__(self):
		logHandler = TimedRotatingFileHandler("C:\\lucas\\PriestPy\\Dropbox\\logs\\HowToPriest",when="midnight",backupCount=365)
		logFormatter = logging.Formatter('%(asctime)s - %(message)s')
		logHandler.setFormatter( logFormatter )
		self.logger = logging.getLogger( 'H2PLogger' )
		self.logger.addHandler( logHandler )
		self.logger.setLevel( logging.INFO )
	
	def log(self, message):
		sent = false
		while not sent:
			try:
				self.logger.info(message.channel.name + ' - ' + message.author.name+': ' + message.content)
				sent = true
			except:
				sleep(0.2)
			