Overridden method that applies SGR codes to log messages.
513095
def format(self, record):
        """"""
        # XXX: idea, colorize message arguments
        s = super(ANSIFormatter, self).format(record)
        if hasattr(self.context, 'ansi'):
            s = self.context.ansi(s, **self.get_sgr(record))
        return s
696034
private String preventLogForging(String logMsg) {

    String result = logMsg;
    // use precompiled pattern for performance reasons
    result = LINEBREAK_PATTERN.matcher(logMsg).replaceAll(SingleLinePatternLayout.LINE_SEP);
    return result;
  }
855566
private void notifyStatus(SmsMessage message) {
        URI callback = message.getStatusCallback();
        if (callback != null) {
            String method = message.getStatusCallbackMethod();
            if (method != null && !method.isEmpty()) {

                if (!org.apache.http.client.methods.HttpGet.METHOD_NAME.equalsIgnoreCase(method)
                        && !org.apache.http.client.methods.HttpPost.METHOD_NAME.equalsIgnoreCase(method)) {
                    final Notification notification = notification(WARNING_NOTIFICATION, 14104, method
                            + " is not a valid HTTP method for <Sms>");
                    storage.getNotificationsDao().addNotification(notification);
                    method = org.apache.http.client.methods.HttpPost.METHOD_NAME;
                }
            } else {
                method = org.apache.http.client.methods.HttpPost.METHOD_NAME;
            }


            List<NameValuePair> parameters = populateReqParams(message);
            HttpRequestDescriptor request = new HttpRequestDescriptor(callback, method, parameters);
            downloader().tell(request, self());

        }
    }
726161
private void overrideViolationMessageIfNecessary(List<Violation> violations) {
        if (violationMessage != null && violations != null) {
            for (Violation violation : violations) {
                violation.setMessage(violationMessage);
            }
        }
    }
99447
@Deprecated
    public void doLogRss( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
        String qs = req.getQueryString();
        rsp.sendRedirect2("./log/rss"+(qs==null?"":'?'+qs));
    }
1307215
private void logScanInfo() {
        StringBuilder strBuilder = new StringBuilder(150);
        if (nodeInScopeCount != 0) {
            strBuilder.append("Scanning ");
            strBuilder.append(nodeInScopeCount);
            strBuilder.append(" node(s) ");
        } else {
            strBuilder.append("No nodes to scan ");
        }
        if (parentScanner.getJustScanInScope()) {
            strBuilder.append("[just in scope] ");
        }
        strBuilder.append("from ").append(hostAndPort);
        if (user != null) {
            strBuilder.append(" as ");
            strBuilder.append(user.getName());
        }
        if (nodeInScopeCount == 0) {
            strBuilder.append(", skipping all plugins.");
        }
        log.info(strBuilder.toString());
    }
753203
def _preprocess_sgm(line, is_sgm):
  """"""
  if not is_sgm:
    return line
  # In SGM files, remove <srcset ...>, <p>, <doc ...> lines.
  if line.startswith("<srcset") or line.startswith("</srcset"):
    return ""
  if line.startswith("<doc") or line.startswith("</doc"):
    return ""
  if line.startswith("<p>") or line.startswith("</p>"):
    return ""
  # Strip <seg> tags.
  line = line.strip()
  if line.startswith("<seg") and line.endswith("</seg>"):
    i = line.index(">")
    return line[i + 1:-6]
1071208
def _as_decode(self, msg):
        """"""
        return {'armed_statuses': [x for x in msg[4:12]],
                'arm_up_states': [x for x in msg[12:20]],
                'alarm_states': [x for x in msg[20:28]]}
494567
def sg_log(tensor, opt):
    
    """
    return tf.log(tensor + tf.sg_eps, name=opt.name)
918023
public static void tryLogForMessage(long now,
            final long maxLogInterval,
            final TimeUnit maxLogIntervalUnit,
            final VoltLogger logger,
            final Level level, String format, Object... parameters) {
        Callable<RateLimitedLogger> builder = new Callable<RateLimitedLogger>() {
            @Override
            public RateLimitedLogger call() throws Exception {
                return new RateLimitedLogger(maxLogIntervalUnit.toMillis(maxLogInterval), logger, level);
            }
        };

        final RateLimitedLogger rll;
        try {
            rll = m_loggersCached.get(format, builder);
            rll.log(now, level, null, format, parameters);
        } catch (ExecutionException ex) {
            Throwables.propagate(Throwables.getRootCause(ex));
        }
    }
1037085
public void trace(String msg) {
        if (logger.isLoggable(Level.FINEST)) {
            log(SELF, Level.FINEST, msg, null);
        }
    }
486969
public void error(final String msg) {
        if (proxy.isErrorEnabled()) {
            if (proxy instanceof LocationAwareLogger) {
                ((LocationAwareLogger) proxy).log(null, FQCN, LocationAwareLogger.ERROR_INT, msg, null, null);
            } else {
                proxy.error(msg);
            }
        }
    }
1363048
def msg(message, *args, **kwargs):
    """"""
    global log_file
    if log_file is None:
        log_file = sys.stderr
    if long_msg:
        file_name, line = caller_trace()
        file_name, file_type = os.path.splitext(file_name)
        if file_name.endswith('/__init__'):
            file_name = os.path.basename(os.path.dirname(file_name))
        elif file_name.endswith('/__main__'):
            file_name = "(-m) {0}".format(
                os.path.basename(os.path.dirname(file_name)))
        else:
            file_name = os.path.basename(file_name)
        head = '{0}{1} ({2}): '.format(file_name, file_type, line)
    else:
        head = '[SERVER] '
    out = StringIO()
    for line in message.format(*args, **kwargs).split('\n'):
        out.write('{0}{1}\n'.format(head, line))
    out.flush()
    out.seek(0)
    if _msg_stderr:
        sys.stderr.write(out.read())
        sys.stderr.flush()
    else:
        log_file.write(out.read())
        log_file.flush()
    out.close()
698399
public void info(String msg, ServiceReference sr, Throwable e) {
        doLog(msg, LOG_INFO, sr, e);
    }
533325
def capture_log_messages( opts = {} )
      from = opts.fetch(:from, 'root')
      to = opts.fetch(:to, '__rspec__')
      exclusive = opts.fetch(:exclusive, true)

      appender = Logging::Appenders[to] || Logging::Appenders::StringIo.new(to)
      logger = Logging::Logger[from]
      if exclusive
        logger.appenders = appender
      else
        logger.add_appenders(appender)
      end

      before(:all) do
        @log_output = Logging::Appenders[to]
      end

      before(:each) do
        @log_output.reset
      end
    end
220933
def _log(self, s):
    """
    # TODO(tewalds): Should this be using logging.info instead? How to see them
    # outside of google infrastructure?
    sys.stderr.write(s)
    sys.stderr.flush()
467931
protected void overrideXtextInternalLoggers() {
		final Logger logger = getLogger();
		final org.apache.log4j.spi.LoggerFactory factory = new InternalXtextLoggerFactory(logger);
		final org.apache.log4j.Logger internalLogger = org.apache.log4j.Logger.getLogger(
				MessageFormat.format(Messages.SarlBatchCompiler_40, logger.getName()), factory);
		setStaticField(BatchLinkableResourceStorageWritable.class, "LOG", internalLogger); //$NON-NLS-1$
		setStaticField(BatchLinkableResource.class, "log", internalLogger); //$NON-NLS-1$
		setStaticField(ProcessorInstanceForJvmTypeProvider.class, "logger", internalLogger); //$NON-NLS-1$
	}