Log file operation

 @api private
428713
def log_status(cmd, message, verbose, color = false)
      return unless verbose

      cmd = cmd.to_s.rjust(12)
      if color
        i = cmd.index(/[a-z]/)
        cmd = cmd[0...i] + decorate(cmd[i..-1], color)
      end

      message = "#{cmd}  #{message}"
      message += "\n" unless message.end_with?("\n")

      @output.print(message)
      @output.flush
    end
858546
static void printToLogFile(String str) {
    try (BufferedWriter bw = new BufferedWriter(new FileWriter(getLogPath(), true))) {
      bw.write(str + logLineBreak);
    } catch (Throwable t) {
      showError(t);
    }
  }
384234
function logs(a) {
  return a.isIgnored?         ''
  :      a.log.length === 0?  ''
  :      /* otherwise */      '\n' + pad( 2
                                        , '=== Captured logs:\n'
                                        + a.log.map(function(x){
                                            return faded('- ' + show(x.log))})
                                          .join('\n') + '\n---\n')
}
286444
function log(patch) {
		var mw = (patch || core.base());
		mw.enabled = true;
		// let's be gentle
		if (console) {
			mw.writeln = function (str) {
				if (mw.enabled) {
					console.log(String(str));
				}
			};
		}
		else {
			mw.writeln = function (/*str*/) {
				// ignore?
			};
		}
		if (!patch) {
			mw.toString = function () {
				return '<miniwrite-log>';
			};
		}
		return mw;
	}
676754
def _log(self, fname, txt, prg=''):
        
        if os.sep not in fname:
            fname = self.log_folder + os.sep + fname
        delim = ','
        q = '"'
        dte = TodayAsString()
        usr = GetUserName()
        hst = GetHostName()
        i = self.session_id
 
        if prg == '':
            prg = 'cls_log.log' 
        logEntry = q + dte + q + delim + q + i + q + delim + q + usr + q + delim + q + hst + q + delim + q + prg + q + delim + q + txt + q + delim + '\n'
        with open(fname, "a", encoding='utf-8', errors='replace') as myfile:
            myfile.write(logEntry)
718763
function log() {
  var _console;

  return Postmate.debug ? (_console = console).log.apply(_console, arguments) : null;
}
754296
function log(isError, message, data){
    var indentifier = 'cacheService: ';
    if(self.verbose || isError){
      if(data) {
        console.log(indentifier + message, data);
      } else {
        console.log(indentifier + message);
      }
    }
  }
787402
def logger
      if !@log_file.respond_to?(:write)
        STDOUT.reopen(File.open(@log_file, (File::WRONLY | File::APPEND | File::CREAT)))
      end
      @logger = Logger.new(STDOUT)
    end
802645
function log () {
    if (argv.stdin && argv.fix) {
      arguments[0] = opts.cmd + ': ' + arguments[0]
      console.error.apply(console, arguments)
    } else {
      console.log.apply(console, arguments)
    }
  }
180735
function log(level, message, stackLevel) {
  //	util.log("log: " + level + " : " + message);		
  var index = log_types.indexOf(level);
  if (index <= log_level) {
//    console.log( typeof message)
    if (typeof message !== 'string') {
      if( message instanceof Error) {
        message = message.toString();
      } else {
        message = JSON.stringify(message);
      }
    }

    if (index == 1) message = "*** " + message;

    if (__stack) {
      var ref = __stack[2];
      var line = ref.getLineNumber();
      var name = ref.getFileName().replace(process.cwd() + '/', '');
      message = "(" + name + ":" + line + "): " + message;

    }

    util.log(log_labels[index] + ' ' + message);
  }
}
130445
function log(isError, message, data){
    if(self.verbose || isError){
      if(data) console.log(self.type + ': ' + message, data);
      else console.log(self.type + message);
    }
  }
499354
function log(str) {
  if (typeof document !== 'undefined') {
    console.log(str)
    const el = document.getElementById('perf')
    el.innerHTML += str
  }
}
538550
def log(event = nil, timestamp = Time.now, **fields)
      ts = ::Instana::Util.time_to_ms(timestamp).to_s
      if custom?
        @data[:data][:sdk][:custom][:logs][ts] = fields
        @data[:data][:sdk][:custom][:logs][ts][:event] = event
      else
        set_tags(:log => fields)
      end
    rescue StandardError => e
      Instana.logger.debug "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
    end
70951
function writeLogFile(file, line) {
     
    if (file === undefined || file === null) {
        return;
    }
    
    fs.appendFile(file, line + os.EOL, {}, function() {
        //
    });
}
773689
def log_action(params)
      case @config.log.to_s
      when 'simple'    then log_simple(params)
      when 'curl'      then log_curl(params)
      when 'curl_auth' then log_curl(params, true)
      end
    end
654893
function log() {
  var args = NS ? [chalk.bold.gray(NS)] : []
  for(var i=0; i<arguments.length; i++) {
    var arg = arguments[i];
    args.push(chalk.cyan( typeof arg === "object" ? JSON.stringify(arg) : arg ))

    // adds a separator
    if(i < arguments.length-1) args.push(chalk.gray("|"));
  }
  if(testLog)   testLog(args);
  else          console.log.apply(null, args)
}
1188594
def write_composer_operation_log(filename):
    
    from featuremonkey.tracing import serializer
    from featuremonkey.tracing.logger import OPERATION_LOG
    ol = copy.deepcopy(OPERATION_LOG)
    ol = serializer.serialize_operation_log(ol)
    with open(filename, 'w+') as operation_log_file:
        operation_log_file.write(json.dumps(ol, indent=4, encoding="utf8"))