/*
Args: message, file, stat, extraText
553083
function logFile(options){
  var message   = options.message,
      file      = options.file,
      stat      = options.stat,
      extraText = options.extraText,
      logger    = options.logger;

  if (!file || !file.relative || (stat && stat.isDirectory())) {
    return;
  }
  var fileName = gutil.colors.magenta(file.relative);
  if (extraText) {
    logger(message, fileName, extraText);
  } else {
    logger(message, fileName);
  }
}
730335
function errorMessage(fileError) {
        var msg = '';
        switch (fileError.code) {
            case FileError.NOT_FOUND_ERR:
                msg = 'File not found';
                break;
            case FileError.SECURITY_ERR:
                // You may need the --allow-file-access-from-files flag
                // if you're debugging your app from file://.
                msg = 'Security error';
                break;
            case FileError.ABORT_ERR:
                msg = 'Aborted';
                break;
            case FileError.NOT_READABLE_ERR:
                msg = 'File not readable';
                break;
            case FileError.ENCODING_ERR:
                msg = 'Encoding error';
                break;
            case FileError.NO_MODIFICATION_ALLOWED_ERR:
                msg = 'File not modifiable';
                break;
            case FileError.INVALID_STATE_ERR:
                msg = 'Invalid state';
                break;
            case FileError.SYNTAX_ERR:
                msg = 'Syntax error';
                break;
            case FileError.INVALID_MODIFICATION_ERR:
                msg = 'Invalid modification';
                break;
            case FileError.QUOTA_EXCEEDED_ERR:
                // You may need the --allow-file-access-from-files flag
                // if you're debugging your app from file://.
                msg = 'Quota exceeded';
                break;
            case FileError.TYPE_MISMATCH_ERR:
                msg = 'Type mismatch';
                break;
            case FileError.PATH_EXISTS_ERR:
                msg = 'File already exists';
                break;
            default:
                msg = 'Unknown FileError code (code= ' + fileError.code + ', type=' + typeof(fileError) + ')';
                break;
        }
        return msg;
    }
186525
function prepMessage (state, level, namespace, message) {
  if (_.isString(message)) {
    const formatArgs = Array.prototype.slice.call(arguments, 3)
    message = format.apply(null, formatArgs)
  }
  log(state, level, namespace, message)
}
124045
def message(
    *tokens: Token,
    end: str = "\n",
    sep: str = " ",
    fileobj: FileObj = sys.stdout,
    update_title: bool = False
) -> None:
    
    if using_colorama():
        global _INITIALIZED
        if not _INITIALIZED:
            colorama.init()
            _INITIALIZED = True
    with_color, without_color = process_tokens(tokens, end=end, sep=sep)
    if CONFIG["record"]:
        _MESSAGES.append(without_color)
    if update_title and with_color:
        write_title_string(without_color, fileobj)
    to_write = with_color if config_color(fileobj) else without_color
    write_and_flush(fileobj, to_write)
843264
function parse(context, file) {
  var message

  if (stats(file).fatal) {
    return
  }

  if (context.treeIn) {
    debug('Not parsing already parsed document')

    try {
      context.tree = json(file.toString())
    } catch (error) {
      message = file.message(
        new Error('Cannot read file as JSON\n' + error.message)
      )
      message.fatal = true
    }

    /* Add the preferred extension to ensure the file, when compiled, is
     * correctly recognized. Only add it if there’s a path — not if the
     * file is for example stdin. */
    if (file.path) {
      file.extname = context.extensions[0]
    }

    file.contents = ''

    return
  }

  debug('Parsing `%s`', file.path)

  context.tree = context.processor.parse(file)

  debug('Parsed document')
}
107379
function extractMessage(error) {
	var {message} = error
	if (error.plugin === 'babel') {
		// Hey Babel, you're not helping!
		var filepath = error.id
		var message = error.message
		function stripFilePath() {
			var index = message.indexOf(filepath)
			console.log(index, filepath.length)
			message = message.slice(0, index) + message.slice(filepath.length + 1)
			message = message.trim()
		}
		if (message.includes(filepath)) {
			stripFilePath()
		} else {
			filepath = filepath.replace(/\\/g, '/')
			if (message.includes(filepath))
				stripFilePath()
		}
	}
	return message
}
793638
def _add_message_file(arg_parser, help_text):
    
    arg_parser.add_argument('--msg-file',
                            type=argparse.FileType('r'),
                            help=help_text)
894669
def message(self, message, item, extra):
        """"""
        if item is not None:
            message += ": " + ascii(item)
        if extra is not None:
            message += " (" + str(extra) + ")"
        return message
1060580
function formatMessage(msg) {
		var args = arguments;
		return msg.replace(/\$\{([^\}]+)\}/g, function(str, index) { return args[(index << 0) + 1]; });
	}
488602
def message(msg, indent=False, mtype='standard', caption=False):
    """"""
    if caption:
        msg = '\n' + msg + '\n' + '-'*len(msg) + '\n'
    if mtype == 'warning':
        msg = colorlog('Warning:  ' + msg, 'yellow')
    if mtype == 'error':
        msg = colorlog('Error:  ' + msg, 'red')
    if mtype == 'debug':
        msg = colorlog('Debug:  ' + msg, 'pink')
    if mtype == 'info':
        msg = colorlog('Info:  ' + msg, 'green')
    if indent:
        msg = '  ' + msg
    sys.stderr.write(msg)
136451
function puts(message, prefix, path) {
    var filestream = this.filestream,
        logPrefix = this.prefix,
        echo = this.echo,
        timestamp = this.timestamp,
        lines, line, i, length;

    if (prefix) {
        logPrefix += prefix;
    }

    if (path && path !== this.path) {
        this.path = path;
        filestream = this.filestream = createWriteStream(path);
    }

    // Message may contain leading, interstitial, or trailing carriage
    // returns and new lines. Carriage returns, when output to the
    // console (terminal) will act as a literal carriage return, going back to
    // the beginning of the line and overwriting content laid down in a
    // previous line, which makes the console (terminal) log look corrupted.
    // The strategy here is to convert all carriage returns into new lines and
    // any group of new lines into one new line and then log each line with the
    // timestamp and prefix. If you decide that all this trimming and
    // indenting can be done more efficiently, please keep the carriage return
    // issue in mind.
    message = message.replace(/\r/g, "\n"); // Carriage return conversion
    message = message.replace(/^\n+|\n+$/g, ""); // Start and end clean up
    message = message.replace(/\n+/g, "\n"); // Group interstitial new lines

    lines = message.split("\n");
    for (i = 0, length = lines.length; i < length; i += 1) {
        line = lines[i];
        if (line.length > 0) { // Disregard empty lines

            if (filestream) {
                filestream.write(timestamp.now() + ':' +
                        logPrefix + line + '\n');
            }

            if (echo) {
                console.log(logPrefix + line);
            }
        }
    }
}
613332
def _file_stat(self, mode, infostr, stat):
        
        action_str = mode.upper()
        info_str = infostr

        if stat == 'OK':
            self.action_st_panel.SetBackgroundColour('#00FF00')
        else:  # ERR
            self.action_st_panel.SetBackgroundColour('#FF0000')
        self.action_st.SetLabel(action_str)
        if info_str is None:
            info_str = 'Undefined File'
        self.info_st.SetLabel(info_str)
        if self.info_st.IsEllipsized():
            self.info_st.SetToolTip(wx.ToolTip(info_str))

        self.log.append({'stat': stat,
                         'logstr':
                             "[{ts}] {acts:<10s} : {infs}".format(ts=time.strftime(
                                 "%Y/%m/%d-%H:%M:%S", time.localtime()),
                                 acts=action_str,
                                 infs=info_str)})
174396
function messageItem( text, optionalOptions = {} ) {
      const {
         level = 'ERROR',
         replacements = [],
         sourceInfo = { file: 'a.js', line: 100 }
      } = optionalOptions;
      return { text, level, replacements, sourceInfo };
   }
338981
function (msg, src) {
            /* globals console */
            if (TinCan.DEBUG && typeof console !== "undefined" && console.log) {
                src = src || this.LOG_SRC || "TinCan";

                console.log("TinCan." + src + ": " + msg);
            }
        }
1189439
def logv(msg, *args, **kwargs):
    
    if settings.VERBOSE:
        log(msg, *args, **kwargs)
184156
def Main():
  
  argument_parser = argparse.ArgumentParser(description=(
      'Calculates a message digest hash for every file in a directory or '
      'storage media image.'))

  argument_parser.add_argument(
      'source', nargs='?', action='store', metavar='image.raw', default=None,
      help=('path of the directory or filename of a storage media image '
            'containing the file.'))

  argument_parser.add_argument(
      '--no-auto-recurse', '--no_auto_recurse', dest='no_auto_recurse',
      action='store_true', default=False, help=(
          'Indicate that the source scanner should not auto-recurse.'))

  options = argument_parser.parse_args()

  if not options.source:
    print('Source value is missing.')
    print('')
    argument_parser.print_help()
    print('')
    return False

  logging.basicConfig(
      level=logging.INFO, format='[%(levelname)s] %(message)s')

  output_writer = StdoutWriter()

  if not output_writer.Open():
    print('Unable to open output writer.')
    print('')
    return False

  return_value = True
  source_analyzer = SourceAnalyzer(auto_recurse=not options.no_auto_recurse)

  try:
    source_analyzer.Analyze(options.source, output_writer)

    print('Completed.')

  except KeyboardInterrupt:
    return_value = False

    print('Aborted by user.')

  output_writer.Close()

  return return_value
717041
function( tmp ) {
      var _length = tmp.val.length;
      return _length === 0 || _length >= tmp.arg || messages.minLength.replace( '{count}', tmp.arg );
    }