Log a message, prefixed with a timestamp.

        If a log file was specified in the constructor, it is written there,
        otherwise it goes to stdout.
325094
def log(self, msg):
        '''
        '''
        if self.logfile:
            fd = self.logfile.fileno()
        else:
            fd = sys.stdout.fileno()

        os.write(fd, ('%.3f %s\n' % (time.time(), msg)).encode('UTF-8'))
177489
def handle_log_entry(self, m):
        ''''''
        if m.time_utc == 0:
            tstring = ''
        else:
            tstring = time.ctime(m.time_utc)
        self.entries[m.id] = m
        print("Log %u  numLogs %u lastLog %u size %u %s" % (m.id, m.num_logs, m.last_log_num, m.size, tstring))
409407
public void doLog(String clientID, String name, long time, Level level,
			Object message, Throwable t) {
		if (logOpen && formatter != null) {
			sendMessage(syslogMessage.createMessageData(formatter.format(clientID, name, time, level, message, t)));
		}
	}
113794
def _outputLine(self, logevent, length=None, human=False):
        
        # adapt timezone output if necessary
        if self.args['timestamp_format'] != 'none':
            logevent._reformat_timestamp(self.args['timestamp_format'],
                                         force=True)
        if any(self.args['timezone']):
            if self.args['timestamp_format'] == 'none':
                self.args['timestamp_format'] = logevent.datetime_format
            logevent._reformat_timestamp(self.args['timestamp_format'],
                                         force=True)

        if self.args['json']:
            print(logevent.to_json())
            return
        line = logevent.line_str

        if length:
            if len(line) > length:
                line = (line[:int(length / 2 - 2)] + '...' +
                        line[int(-length / 2 + 1):])
        if human:
            line = self._changeMs(line)
            line = self._formatNumbers(line)

        print(line)
157899
def log(duration, message=None, use_last_commit_message=False):
    
    branch = git.branch
    issue = jira.get_issue(branch)
    # Create the comment
    comment = "Working on issue %s" % branch
    if message:
        comment = message
    elif use_last_commit_message:
        comment = git.get_last_commit_message()

    if issue:
        # If the duration is provided use it, otherwise use the elapsed time since the last mark
        duration = jira.get_elapsed_time(issue) if duration == '.' else duration

        if duration:
            # Add the worklog
            jira.add_worklog(issue, timeSpent=duration, adjustEstimate=None, newEstimate=None, reduceBy=None,
                             comment=comment)

            print "Logged %s against issue %s (%s)" % (duration, branch, comment)
        else:
            print "No time logged, less than 0m elapsed."
760191
def log(message, type):
    """"""

    (sys.stdout if type == 'notice' else sys.stderr).write(message + "\n")
387023
def start_logging(log_file='', log_level='INFO', verbose=False):
    
    if not log_file:
        # create log directory if it doesn't exist
        log_dir = os.path.abspath('log') + '/'
        if not os.path.isdir(log_dir):
            os.mkdir(log_dir)

        # path to new log file
        log_file = log_dir + 'log.run.' + str(datetime.datetime.now()).replace(':', '.') + '.txt'

    # logger options
    lvl = logging.DEBUG if log_level.upper() == 'DEBUG' else logging.INFO

    # ignore warnings if not in debug
    if log_level.upper() != 'DEBUG':
        warnings.filterwarnings('ignore')

    # define logging format
    if verbose:
        myformat = '%(asctime)s - %(name)s - %(levelname)s \n>>>  %(message)s'
    else:
        myformat = '%(message)s'

    # create logger
    if not log_file == 'stdout':
        # normal logging to a regular file
        logging.basicConfig(level=lvl,
                            format=myformat,
                            filename=log_file,
                            filemode='w')
    else:
        # logging to stdout
        root = logging.getLogger()
        root.setLevel(lvl)
        stdout_stream = logging.StreamHandler(sys.stdout)
        stdout_stream.setLevel(lvl)
        formatter = logging.Formatter(myformat)
        stdout_stream.setFormatter(formatter)
        root.addHandler(stdout_stream)
        root.propagate = True
167341
def log(program, message, exit_status = nil, files = nil)
      File.open(File.join(@log_directory, @log_file), "a") do |log|
        log.puts ""
        log.puts Time.now.to_s + " " + program
        log.puts message
        log.puts ""
      end

      if exit_status
        remove_files(files) unless files.nil?
        exit exit_status.to_i
      end
    end
735062
function Log(prefix, path, echo, timestamp) {
    var filestream;

    if (path) {
        filestream = createWriteStream(path);
    }

    timestamp = timestamp || require('./timestamp');

    return {
        prefix: prefix,
        path: path,
        filestream: filestream,
        echo: echo,
        timestamp: timestamp,
        puts: puts
    };
}
552996
function writeLog () {
  if (mocking) {
    cli.stdout += stripAnsi(concatArguments(arguments))
  } else {
    process.stdout.write.apply(process.stdout, arguments)
  }
}
456096
function _log(message) {
    if (cluster.isMaster) {
        // write directly to the log file
        console.log(_format(message));
    }
    else {
        // send to master
        cluster.worker.process.send({
            type: "logging",
            data: {
                message: message,
                workerID: cluster.worker.id,
                pid: cluster.worker.process.pid
            }
        });
    }
}
272146
def write_log(self, message):
        
        if self.stream_log and not self.ended:
            # points to the Git stream write
            self.stream_log.write(message)
            return True
459050
def _init_log(level=logging.DEBUG):
    
    log = logging.getLogger(__file__)
    log.setLevel(level)
    handler = logging.StreamHandler(sys.stdout)
    handler.setLevel(level)
    formatter = logging.Formatter('%(asctime)s: %(message)s',
                                  '%Y/%m/%d-%H:%M:%S')
    handler.setFormatter(formatter)
    log.addHandler(handler)
    return log
376348
def _create_stdout_logger():
    
    log = logging.getLogger(__name__)
    out_hdlr = logging.StreamHandler(sys.stdout)
    out_hdlr.setFormatter(logging.Formatter('%(message)s'))
    out_hdlr.setLevel(logging.INFO)
    log.addHandler(out_hdlr)
    log.setLevel(logging.INFO)
1056901
def init_log(log_file):
    
    #Create the log file
    log = None
    try:
        log = open(log_file, 'a')

        #Change the output to both the windows and log file
        #original = sys.stdout
        sys.stdout = Tee(sys.stdout, log)
    except:
        pass
    return log
115912
private synchronized void log(String moduleName, String message) {

        // We re-open the file every time. This should be OK performance-wise, since modules are usually not
        // imported/exported/deleted so frequently that this would matter.
        File logFile = getLogFile(moduleName);
        logFile.getParentFile().mkdirs();
        FileOutputStream out = null;
        PrintStream ps = null;
        try {
            out = new FileOutputStream(logFile, true); // open file with append=true
            ps = new PrintStream(out);
            ps.println(message);
        } catch (IOException e) {
            LOG.error(e.getLocalizedMessage(), e);
        } finally {
            if (ps != null) {
                ps.close();
            }
        }
    }
942333
function logMessage(time, path, message, mode) {
  if (config.logToConsole) {
    console.log(mode ? '['+mode+']' : '', path, message)
  }
  if (dataFile) {
    dataFile.log(time, path, message, mode)
  }
}