python - How to copy the logging information of a program to an existing file? -


my book states copy logging information file ( assume it's name cover.txt ) add following code in program: logging.basicconfig(filename='cover.txt',level=logging.debug,format=' %(asctime)s - %(levelname)s - %(message)s')

when run program, new file named cover created in documents folder! , logging information copied file , not file have made.

does happen? if not, how can copy logging info original file cover.txt?

when run program, new file named cover created in documents folder! , logging information copied file , not file have made.

the program working correctly. don't create logging file first, application create automatically.

this because logging module in python comprehensive, can log files, network locations, console, email addresses, other servers , when comes logging files - can automatically rotate log files.

for example, can configure logging module create new log file every day, or after log file reaches size, create new log file.

that's why program creating files you.

if file called cover because default windows hide extensions of files.

you can disable option "view" menu of windows explorer.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -