Announce theta values to the log.
357401
def _announce_theta(theta):
    

    c = 299792.458 # km/s
    is_a_redshift = lambda p: p == "z" or p[:2] == "z_"

    for parameter, value in theta.items():
        try:
            value[0]
        except (IndexError, TypeError):
            message = "\t{0}: {1:.3f}".format(parameter, value)
            if is_a_redshift(parameter):
                message += " [{0:.1f} km/s]".format(value * c)
        else:
            # (MAP, u_pos, u_neg)
            message = "\t{0}: {1:.3f} ({2:+.3f}, {3:+.3f})".format(parameter,
                value[0], value[1], value[2])
            if is_a_redshift(parameter):
                message += " [{0:.1f} ({1:+.1f}, {2:+.1f}) km/s]".format(
                    value[0] * c, value[1] * c, value[2] * c)
        logger.info(message)
359421
def display(level='DEBUG'):
    """"""
    logger = get_logger()
    sh = logging.StreamHandler()
    sh.setLevel(getattr(logging, level))
    sh.setFormatter(DEFAULT_LOG_FORMAT)
    logger.addHandler(sh)
93846
def configure_logging(verbose, logger):
    """"""
    if not verbose:
        log_level = logging.WARNING
    elif verbose == 1:
        log_level = logging.INFO
    else:
        log_level = logging.DEBUG
    logger.setLevel(log_level)
    ch = colorlog.StreamHandler()
    ch.setLevel(log_level)
    formatter = colorlog.ColoredFormatter(
        '%(log_color)s%(asctime)s %(name)s %(levelname)s: %(message)s')
    ch.setFormatter(formatter)
    logger.addHandler(ch)
1161080
def log(self, *args, **kwargs):
        """"""
        if self.verbose:
            print('   ' * self.depth, *args, **kwargs)
1069669
private String formatLogString(Diagnostics diagnostics) {

    StringBuilder sb = new StringBuilder();
    sb.append(LOG_STRING_PREFIX).append(SEPARATOR);
    if (null != diagnostics.getId()) {
      sb.append("id=").append(diagnostics.getId()).append(SEPARATOR);
    }
    if (null != diagnostics.getTimestamp()) {
      sb.append("date=").append(formatter.format(new DateTime(diagnostics.getTimestamp()).toDate())).append(SEPARATOR);
    }
    if (null != diagnostics.getTag()) {
      sb.append("tag=").append(diagnostics.getTag()).append(SEPARATOR);
    }
    if (null != diagnostics.getInfo()) {
      sb.append("info=").append(diagnostics.getInfo()).append(SEPARATOR);
    }

    return sb.toString();
  }
1332814
def log(self, level, *msg_elements):
    """"""
    self.report.log(self._threadlocal.current_workunit, level, *msg_elements)
645339
def printlog(self, string, verbose=None, flush=False):
        """"""
        if self.writelog:
            self.logger.info(string)
        if verbose or (self.verbose and verbose is None):
            print(string, flush=flush)
167824
def log(self, text, key="?????", force=False):
        """"""
        if force or self.verbose:
            print ">>>> {} {}".format(key, text)
            sys.stdout.flush()
1033827
def log(self, level, *args, **kwargs):
        """"""
        return self._log_kw(level, args, kwargs)
446657
def _update(self):
        '''
        
        '''
        try:
            theta_radians = math.atan(float(self.dy)/self.dx)
        except ZeroDivisionError:
            if self.dy > 0: theta_radians = 0.5*math.pi
            elif self.dy < 0: theta_radians = 1.5*math.pi
            self.magnitude = self.dy
        else:
            self.magnitude = 1./(math.cos(theta_radians))*self.dx
        theta = math.degrees(theta_radians)
        self.heading = self._angle_or_heading(theta)
1046734
def tail(ctx):
    """"""
    click.echo('tailing logs')
    for e in ctx.tail()[-10:]:
        ts = datetime.utcfromtimestamp(e['timestamp'] // 1000).isoformat()
        click.echo("{}: {}".format(ts, e['message']))
    click.echo('done')
11011
def _stab_log_data(self, timestamp, data, logconf):
        """"""
        print('[%d][%s]: %s' % (timestamp, logconf.name, data))
437010
function log(type, args, color){
  pad();
  var msg = format.apply(format, args);
  if (color) msg = chalk[color](msg);
  var pre = prefix();
  console[type](pre, msg);
}
262226
def log (self, msg, prefix=None):
    """"""
    if prefix:
      if not prefix.strip().endswith(':'):
        prefix += ': '
      msg = prefix + msg
    self.messages.append(msg)
565773
def rotate(self, log):
        """"""
        self.write(log, rotate=True)
        self.write({})
566979
def set_log_level(self, level: str) -> None:
        """"""
        if level == 'info':
            to_set = logging.INFO
        if level == 'debug':
            to_set = logging.DEBUG
        if level == 'error':
            to_set = logging.ERROR
        self.log.setLevel(to_set)
1020069
def info(self, msg, indent=0, **kwargs):
        """"""
        return self.logger.info(self._indent(msg, indent), **kwargs)