appends the log to confluence page if found, if not creates new page
 clears the log
775217
def report_event(name, parrent_page_id=nil, space=nil)
            page = find_page_by_name(name, parrent_page_id)
            if page
                append_to_page(page["id"], parrent_page_id)
            else
                create_page(name, space, parrent_page_id)
            end
            clear_log
        end
499303
def initialize_log(log)
      close if @log # be sure that we don't leave open files laying around.

      if log.respond_to?(:write)
        @log = log
      elsif File.exist?(log)
        @log = open(log, (File::WRONLY | File::APPEND))
        @log.sync = true
      else
        FileUtils.mkdir_p(File.dirname(log)) unless File.directory?(File.dirname(log))
        @log = open(log, (File::WRONLY | File::APPEND | File::CREAT))
        @log.sync = true
        @log.write("#{Time.now.httpdate} #{delimiter} info #{delimiter} Logfile created\n")
      end
    end
552202
function(appenders) {
		//clear first all existing appenders
		for(var i = 0; i < this.appenders.length; i++) {
			this.appenders[i].doClear();
		}
		
		this.appenders = appenders;
		
		for(var j = 0; j < this.appenders.length; j++) {
			this.appenders[j].setLogger(this);
		}
	}
826474
def _write_to_log(self, s, truncate=False):
        """"""
        # if truncate is True, set write mode to truncate
        with open(self._logfile, 'w' if truncate else 'a') as fp:
            fp.writelines((to_text(s) if six.PY2 else to_text(s), ))
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
541466
public function log(): void
    {
        if (file_exists(FLOW_PATH_DATA . 'Logs/Elasticsearch') && is_dir(FLOW_PATH_DATA . 'Logs/Elasticsearch') && is_writable(FLOW_PATH_DATA . 'Logs/Elasticsearch')) {
            file_put_contents($this->filename, $this->renderErrors());
            $this->logger->log($this->message, LOG_ERR, [], 'Flowpack.ElasticSearch.ContentRepositoryAdaptor', __CLASS__, __FUNCTION__);
        } else {
            $this->logger->log(sprintf('Could not write indexing errors backtrace into %s because the directory could not be created or is not writable.', FLOW_PATH_DATA . 'Logs/Elasticsearch/'), LOG_WARNING, [], 'Flowpack.ElasticSearch.ContentRepositoryAdaptor', __CLASS__, __FUNCTION__);
        }
    }
779423
def _add_recent(self, doc, logged_id):
		""
		spec = dict(channel=doc['channel'])
		doc['ref'] = logged_id
		doc.pop('_id')
		self._recent.replace_one(spec, doc, upsert=True)
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
    };
}
229015
function (config) {
    config = config || {};
    Appender.call(this, config);

    /**
     * Log file name, initialized from the configuration. Folders up to the
     * file must exist beforehand.
     */
    this.fileName = config.fileName;

    /**
     * Append log events to the end of the file when true, clear the file
     * before writing the first log event otherwise.
     */
    this.appendToFile = (typeof config.append !== 'undefined') ?
      !!config.append :
      true;

    /**
     * True to log strings instead of objects
     */
    this.appendStrings = (typeof config.appendStrings !== 'undefined') ?
      config.appendStrings :
      true;

    /**
     * The file stream, initialized by the "start" function
     */
    this.stream = null;
  }
1236035
private function addLogs()
    {
        $createdBy = new GeneratorField();
        $createdBy->name = 'created_by';
        $createdBy->parseDBType('integer');
        $createdBy->parseOptions('if,n');
        $this->fields[] = $createdBy;

        $updatedBy = new GeneratorField();
        $updatedBy->name = 'updated_by';
        $updatedBy->parseDBType('integer');
        $updatedBy->parseOptions('if,n'); // edited by dandisy
        $this->fields[] = $updatedBy;
    }
937136
def save_page(p)
      if p.record.page_entries != p.values.length
        raise RuntimeError, "page_entries mismatch for node #{p.uid}"
      end
      begin
        @f.seek(p.uid * @page_size * 8)
        @f.write(p.values.pack('Q*'))
      rescue IOError => e
        PEROBS.log.fatal "Cannot write cache file #{@file_name}: #{e.message}"
      end
    end
244181
protected static void appendHandler(LogRecordHandler parent, LogRecordHandler child){
    RecordHandlerTree p = handlers.find(parent);
    if(p != null){
      p.addChild(child);
    } else {
      throw new IllegalArgumentException("No such parent handler: " + parent);
    }
  }
1190784
public void doAppend(LoggingEvent event)
    {
        if(closed) {
            LogLog.error("Attempted to append to closed appender named [" + name + "].");
            return;
        }

        if(!isAsSevereAsThreshold(event.getLevel())) {
            return;
        }

        Filter f = this.headFilter;

        FILTER_LOOP:
        while(f != null) {
            switch(f.decide(event)) {
            case Filter.DENY: return;
            case Filter.ACCEPT: break FILTER_LOOP;
            case Filter.NEUTRAL: f = f.getNext();
            }
        }

        this.append(event);
    }
790235
function _append_log($message_number, $message)
    {
        // remove the byte identifying the message type from all but the first two messages (ie. the identification strings)
        if (strlen($message_number) > 2) {
            $this->_string_shift($message);
        }

        switch (NET_SSH2_LOGGING) {
            // useful for benchmarks
            case self::LOG_SIMPLE:
                $this->message_number_log[] = $message_number;
                break;
            // the most useful log for SSH2
            case self::LOG_COMPLEX:
                $this->message_number_log[] = $message_number;
                $this->log_size+= strlen($message);
                $this->message_log[] = $message;
                while ($this->log_size > self::LOG_MAX_SIZE) {
                    $this->log_size-= strlen(array_shift($this->message_log));
                    array_shift($this->message_number_log);
                }
                break;
            // dump the output out realtime; packets may be interspersed with non packets,
            // passwords won't be filtered out and select other packets may not be correctly
            // identified
            case self::LOG_REALTIME:
                switch (PHP_SAPI) {
                    case 'cli':
                        $start = $stop = "\r\n";
                        break;
                    default:
                        $start = '<pre>';
                        $stop = '</pre>';
                }
                echo $start . $this->_format_log(array($message), array($message_number)) . $stop;
                @flush();
                @ob_flush();
                break;
            // basically the same thing as self::LOG_REALTIME with the caveat that self::LOG_REALTIME_FILE
            // needs to be defined and that the resultant log file will be capped out at self::LOG_MAX_SIZE.
            // the earliest part of the log file is denoted by the first <<< START >>> and is not going to necessarily
            // at the beginning of the file
            case self::LOG_REALTIME_FILE:
                if (!isset($this->realtime_log_file)) {
                    // PHP doesn't seem to like using constants in fopen()
                    $filename = self::LOG_REALTIME_FILENAME;
                    $fp = fopen($filename, 'w');
                    $this->realtime_log_file = $fp;
                }
                if (!is_resource($this->realtime_log_file)) {
                    break;
                }
                $entry = $this->_format_log(array($message), array($message_number));
                if ($this->realtime_log_wrap) {
                    $temp = "<<< START >>>\r\n";
                    $entry.= $temp;
                    fseek($this->realtime_log_file, ftell($this->realtime_log_file) - strlen($temp));
                }
                $this->realtime_log_size+= strlen($entry);
                if ($this->realtime_log_size > self::LOG_MAX_SIZE) {
                    fseek($this->realtime_log_file, 0);
                    $this->realtime_log_size = strlen($entry);
                    $this->realtime_log_wrap = true;
                }
                fputs($this->realtime_log_file, $entry);
        }
    }
51571
public boolean append(AuditContext context) {
    try {
      mAuditLogEntries.put(context);
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      return false;
    }
    return true;
  }
33807
def add_log(self, x, flag_also_show=False):
        """"""
        self.parent_form.add_log(x, flag_also_show)
657322
function(message) {
            $log
              .append( settings.templates.message(message) )
            ;
            module.message.scroll.test();
            $.proxy(settings.onMessage, $log.children().last() )();
          }