示例#1
0
    def report(self, verbose=False):
        if verbose:
            p = self.prefix + ": "
            if self.step:
                q = u" (step " + six.text_type(self.step) + u")"
            else:
                q = ""
            if self.worker:
                for r in self.worker.report(verbose):
                    yield p + r
                    p = " " * len(self.prefix) + ": "
                if p == " " * len(self.prefix) + ": ":
                    p = " " * (len(self.prefix) - 2) + "at: "
            if self.seq:
                for r in self.seq.report(False):
                    yield p + r + q
                    p = " " * len(self.prefix) + ": "
                    q = ""
                p = " " * (len(self.prefix) - 2) + "ev: "
                for r in report_(self.seq.event, False):
                    yield p + r
                    p = " " * len(self.prefix) + ": "

        else:
            yield self.prefix + u": " + six.text_type(self.worker)
示例#2
0
文件: logging.py 项目: M-o-a-T/moat
	def report(self, verbose=False):
		if verbose:
			p = self.prefix+": "
			if self.step:
				q = u" (step "+six.text_type(self.step)+u")"
			else:
				q = ""
			if self.worker:
				for r in self.worker.report(verbose):
					yield p+r
					p = " "*len(self.prefix)+": "
				if p == " "*len(self.prefix)+": ":
					p = " "*(len(self.prefix)-2)+"at: "
			if self.seq:
				for r in self.seq.report(False):
					yield p+r+q
					p = " "*len(self.prefix)+": "
					q = ""
				p = " "*(len(self.prefix)-2)+"ev: "
				for r in report_(self.seq.event,False):
					yield p+r
					p = " "*len(self.prefix)+": "

		else:
			yield self.prefix+u": "+six.text_type(self.worker)
示例#3
0
 def log_event(self, event, level):
     if level >= self.level:
         for r in report_(event, 99):
             self._wlog(LogNames[level], r)
         if TESTING:
             self.flush()
示例#4
0
文件: logging.py 项目: M-o-a-T/moat
	def log_event(self, event, level):
		if level >= self.level:
			for r in report_(event,99):
				self._wlog(LogNames[level],r)
			if TESTING:
				self.flush()