Did I find the right examples for you? yes no

All Samples(87)  |  Call(78)  |  Derive(0)  |  Import(9)
Initialize logging to a specified observer. If setStdout is true
(defaults to yes), also redirect sys.stdout and sys.stderr
to the specified file.

        def startLoggingWithObserver(observer, setStdout=1):
    """Initialize logging to a specified observer. If setStdout is true
       (defaults to yes), also redirect sys.stdout and sys.stderr
       to the specified file.
    """
    global defaultObserver, _oldshowwarning
    if not _oldshowwarning:
        _oldshowwarning = warnings.showwarning
        warnings.showwarning = showwarning
    if defaultObserver:
        defaultObserver.stop()
        defaultObserver = None
    addObserver(observer)
    msg("Log opened.")
    if setStdout:
        sys.stdout = logfile
        sys.stderr = logerr
        


src/s/p/spyne-HEAD/examples/twisted/_service.py   spyne(Download)
 
    observer = log.PythonLoggingObserver('twisted')
    log.startLoggingWithObserver(observer.emit, setStdout=False)
 
    application = Application(services, 'spyne.examples.twisted.hello',

src/o/h/oh-mainline-HEAD/vendor/packages/scrapy/scrapy/log.py   oh-mainline(Download)
        sflo = ScrapyFileLogObserver(file, loglevel, settings['LOG_ENCODING'])
        _oldshowwarning = warnings.showwarning
        log.startLoggingWithObserver(sflo.emit, setStdout=logstdout)
        # restore warnings, wrongly silenced by Twisted
        warnings.showwarning = _oldshowwarning

src/u/n/UnitScan-HEAD/scrapy/log.py   UnitScan(Download)
        sflo = ScrapyFileLogObserver(file, loglevel, settings['LOG_ENCODING'])
        _oldshowwarning = warnings.showwarning
        log.startLoggingWithObserver(sflo.emit, setStdout=logstdout)
        # restore warnings, wrongly silenced by Twisted
        warnings.showwarning = _oldshowwarning

src/s/c/scrapy-HEAD/scrapy/log.py   scrapy(Download)
    sflo = ScrapyFileLogObserver(file, loglevel, logencoding, crawler)
    _oldshowwarning = warnings.showwarning
    log.startLoggingWithObserver(sflo.emit, setStdout=logstdout)
    # restore warnings, wrongly silenced by Twisted
    warnings.showwarning = _oldshowwarning

src/s/c/Scrapy-0.22.2/scrapy/log.py   Scrapy(Download)
    sflo = ScrapyFileLogObserver(file, loglevel, logencoding, crawler)
    _oldshowwarning = warnings.showwarning
    log.startLoggingWithObserver(sflo.emit, setStdout=logstdout)
    # restore warnings, wrongly silenced by Twisted
    warnings.showwarning = _oldshowwarning

src/t/w/TwistedBot-HEAD/twistedbot/logbot.py   TwistedBot(Download)
 
 
log.startLoggingWithObserver(MinecraftLogObserver(sys.stdout).emit, setStdout=0)
default_logger = getlogger("-")
default_logger.msg("Start logging")

src/c/r/crawlmi-HEAD/crawlmi/log.py   crawlmi(Download)
    observer = CrawlmiFileLogObserver(file, loglevel, encoding)
    _oldshowwarning = warnings.showwarning
    log.startLoggingWithObserver(observer.emit, setStdout=logstdout)
    # restore warnings, wrongly silenced by Twisted
    warnings.showwarning = _oldshowwarning

src/t/w/twisted-lock-HEAD/lock/utils.py   twisted-lock(Download)
 
        observer = LogbookObserver()
        twisted.python.log.startLoggingWithObserver(observer.emit, setStdout = False)
        _logging_initialized = True
 

src/o/h/oh-mainline-HEAD/vendor/packages/twisted/twisted/python/syslog.py   oh-mainline(Download)
    """
    obs = SyslogObserver(prefix, options, facility)
    log.startLoggingWithObserver(obs.emit, setStdout=setStdout)
 

src/h/a/hackabot-HEAD/lib/python/hackabot/log.py   hackabot(Download)
        _loud_init = True
 
    log.startLoggingWithObserver(_logger, setStdout=0)
 
def init_stdio():

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8  Next