python - dir_util.copy_tree won't print the files that it copies -
i'm using python 2.6. use dir_util.copy_tree function copy files, , want see files copied on command line. however, never prints them out, when specify verbose=1! known bug, or doing wrong?
here's code:
distutils.dir_util.copy_tree(source, dest, verbose=1)
the copy_tree
command uses distutils.log
write screen. in case need info
level.
so should trick:
from distutils import log log.set_verbosity(log.info) log.set_threshold(log.info)
note writes sys.stderr
warn
, error
, fatal
, sys.stdout
debug
, info
.
in case newer versions implement logging module have setup logging config work:
import logging logging.basicconfig(level=logging.info)
Comments
Post a Comment