tmuxp.log.setup_log_file
-
Attach a file handler to the tmuxp logger.
Examples#
>>> import tempfile, os, logging>>> f = tempfile.NamedTemporaryFile(suffix=".log", delete=False)>>> f.close()>>> setup_log_file(f.name, level="INFO")>>> tmuxp_logger = logging.getLogger("tmuxp")>>> tmuxp_logger.handlers = [... h for h in tmuxp_logger.handlers if not isinstance(h, logging.FileHandler)... ]>>> os.unlink(f.name)