Enqueue a call to log.
358638
def enqueue(self, name, value, valueType=None, stamp=None):
    """"""
    # If queue is too large, refuse to log.
    if self.maxQueueSize and self.queue.qsize() > self.maxQueueSize:
      return
    # Stick arguments into the queue
    self.queue.put((name, value, valueType, stamp))
1305681
def setup_logging(logging_config, debug=False):
    """"""

    if logging_config is not None:
        logging.config.fileConfig(logging_config)

    else:
        logging.basicConfig(level=debug and logging.DEBUG or logging.ERROR)
6632
async def pop_log(self):
        """"""
        self._check_receive_loop()
        res = self.log_queue.get()
        self._check_error(res)
        return res
1168983
def c_log(level, message):
    """"""
    c_level = level
    level = LEVELS_F2PY[c_level]
    logger.log(level, message)
919961
def _enqueue_capture(build, release, run, url, config_data, baseline=False):
    """"""
    # Validate the JSON config parses.
    try:
        config_dict = json.loads(config_data)
    except Exception, e:
        abort(utils.jsonify_error(e))

    # Rewrite the config JSON to include the URL specified in this request.
    # Blindly overwrite anything that was there.
    config_dict['targetUrl'] = url
    config_data = json.dumps(config_dict)

    config_artifact = _save_artifact(build, config_data, 'application/json')
    db.session.add(config_artifact)
    db.session.flush()

    suffix = ''
    if baseline:
        suffix = ':baseline'

    task_id = '%s:%s%s' % (run.id, hashlib.sha1(url).hexdigest(), suffix)
    logging.info('Enqueueing capture task=%r, baseline=%r', task_id, baseline)

    work_queue.add(
        constants.CAPTURE_QUEUE_NAME,
        payload=dict(
            build_id=build.id,
            release_name=release.name,
            release_number=release.number,
            run_name=run.name,
            url=url,
            config_sha1sum=config_artifact.id,
            baseline=baseline,
        ),
        build_id=build.id,
        release_id=release.id,
        run_id=run.id,
        source='request_run',
        task_id=task_id)

    # Set the URL and config early to indicate to report_run that there is
    # still data pending even if 'image' and 'ref_image' are unset.
    if baseline:
        run.ref_url = url
        run.ref_config = config_artifact.id
    else:
        run.url = url
        run.config = config_artifact.id
101229
def call!(env)
      log "===== Received request ====="
      Rack::Request.new(env).tap do |request|
        log "  Method:  #{request.request_method.inspect}"
        log "  Path:    #{request.path.inspect}"
      end
      env['deas.logging'] = Proc.new{ |msg| log(msg) }
      status, headers, body = super(env)
      log "  Redir:   #{headers['Location']}" if headers.key?('Location')
      log "===== Completed in #{env['deas.time_taken']}ms (#{response_display(status)}) ====="
      [status, headers, body]
    end
710376
def enqueue(self, stream_url, offset=0, opaque_token=None):
        """"""
        directive = self._play_directive('ENQUEUE')
        audio_item = self._audio_item(stream_url=stream_url,
                                      offset=offset,
                                      push_buffer=False,
                                      opaque_token=opaque_token)
        audio_item['stream']['expectedPreviousToken'] = current_stream.token

        directive['audioItem'] = audio_item
        self._response['directives'].append(directive)
        return self
1095976
def add_log_callback(callback):
    """"""
    global _log_callbacks

    if not callable(callback):
        raise ValueError("Callback must be callable")

    _log_callbacks.add(callback)
    return callback
1234519
def cli(env):
    """"""
    mgr = SoftLayer.EventLogManager(env.client)

    event_log_types = mgr.get_event_log_types()

    table = formatting.Table(COLUMNS)

    for event_log_type in event_log_types:
        table.add_row([event_log_type])

    env.fout(table)
785691
def log_handler(level: str, message: str) -> None:
    """"""
    message = 'JS: ' + str(message)
    if level == 'error':
        logger.error(message)
    elif level == 'warn':
        logger.warning(message)
    elif level == 'info':
        logger.info(message)
    elif level == 'debug':
        logger.debug(message)
274791
function enqueue(fn) {
  window._vis_opt_queue = window._vis_opt_queue || [];
  window._vis_opt_queue.push(fn);
}
262226
def log (self, msg, prefix=None):
    """"""
    if prefix:
      if not prefix.strip().endswith(':'):
        prefix += ': '
      msg = prefix + msg
    self.messages.append(msg)
554508
def log_request(self, code='-', size='-'):
        """"""
        print_size = getattr(thread_local, 'size', -1)
        if size != '-':
            size_str = ' (%s)' % size
        elif print_size >= 0:
            size_str = self.log_size_string(print_size) + ' '
        else:
            size_str = ''
        if not self.server.suppress_noise or (code != 200 and code != 304):
            self.log_message(
                '%s"%s" %s', size_str, self.requestline, str(code))
        if print_size >= 0:
            thread_local.size = -1
79754
def re_enqueue(self, item):
        """"""
        if 'retries' in item:
            retries = item['retries']
            if retries >= self.MAX_RETRIES:
                log.warn("Failed to execute {} after {} retries, give it "
                         " up.".format(item['method'], retries))
            else:
                retries += 1
                item['retries'] = retries
                self._q.put_nowait(item)
        else:
            item['retries'] = 1
            self._q.put_nowait(item)
31676
def log(self, *msg, sep='', end='\n', flush=False):
        """"""
        if not self.quiet:
            print(*msg, sep=sep, end=end, flush=flush)
1044611
def make_call_with_cb(self, fun, *args):
        """"""

        cid, event = self.handler.register_callback()
        argscp = list(args)
        argscp.append(cid)
        self.make_call(fun, *argscp)
        return event
1131521
def queue_call(self, delay, callback, *args, **kwds):
    """"""
    if delay is None:
      self.current.append((callback, args, kwds))
      return
    if delay < 1e9:
      when = delay + self.clock.now()
    else:
      # Times over a billion seconds are assumed to be absolute.
      when = delay
    self.insort_event_right((when, callback, args, kwds))