def setup_from_flags(self):
        global _filelog
        if FLAGS.use_syslog:
            self.syslog = SysLogHandler(address='/dev/log')
            self.addHandler(self.syslog)
        elif self.syslog:
            self.removeHandler(self.syslog)
        logpath = _get_log_file_path()
        if logpath:
            self.removeHandler(self.streamlog)
            if logpath != self.logpath:
                self.removeHandler(self.filelog)
                self.filelog = WatchedFileHandler(logpath)
                self.addHandler(self.filelog)
                self.logpath = logpath

                mode = int(FLAGS.logfile_mode, 8)
                st = os.stat(self.logpath)
                if st.st_mode != (stat.S_IFREG | mode):
                    os.chmod(self.logpath, mode)
        else:
            self.removeHandler(self.filelog)
            self.addHandler(self.streamlog)
        if FLAGS.publish_errors:
            self.addHandler(PublishErrorsHandler(ERROR))
        if FLAGS.verbose:
            self.setLevel(DEBUG)
        else:
            self.setLevel(INFO)
Setup logger from flags.
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/log.py/NovaRootLogger.setup_from_flags