python logging does not release file -


i have been using logging , notice after first compile, output file logging hangs, , cannot remove till close idle.

i believe should "close" logging before compilation finishs, don't know how way using logging:

logfile = os.path.join(backup_folder,'test.log') logging.basicconfig(filename=logfile,level=logging.debug,format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s') logging.debug('test') 

so seems have found way adding in end:

logging.shutdown() 

this instruction close handlers openned.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -