Log the reason for modification
960268
public boolean logModified(Logger log)
  {
    if (_isDigestModified) {
      log.info(_source.getNativePath() + " digest is modified.");

      return true;
    }

    long sourceLastModified = _source.getLastModified();
    long sourceLength = _source.length();

    // if the source was deleted and we need the source
    if (! _requireSource && sourceLastModified == 0) {
      return false;
    }
    // if the length changed
    else if (sourceLength != _length) {
      log.info(_source.getNativePath() + " length is modified (" +
               _length + " -> " + sourceLength + ")");

      return true;
    }
    // if the source is newer than the old value
    else if (sourceLastModified != _lastModified) {
      log.info(_source.getNativePath() + " time is modified.");
      
      return true;
    }
    else
      return false;
  }
651770
def changes(self):
        """"""
        obj = AuditLogChanges(self, self._changes)
        del self._changes
        return obj
4888
def log(*args, **kwargs):
    """"""
    level = kwargs.pop('level', logging.INFO)
    logger.log(level, *args, **kwargs)
1211208
def _details(self, nohtml=False):
        """"""
        text = ""
        inst = self.timemachine

        # If deleted or created, show every field, otherwise only
        # the modified
        if self.action_type in ("dl","cr",):
            fields = inst.fields + inst.foreignkeys
        else: fields = [i.key for i in self.modification_commits.all()]

        for field in fields:
            if not nohtml:
                text += "<strong>%s</strong>: " % field
            else:
                text += "%s: " % field

            # If modified, show what it was like one step earlier
            if self.action_type == "md":
                if not nohtml:
                    text += "%s &#8594; " % \
                            inst.at_previous_action._field_value_html(field)
                else:
                    text += "%s -> " % \
                            inst.at_previous_action._field_value_text(field)

            if not nohtml:
                text += "%s<br/>" % inst._field_value_html(field)
            else:
                text += "%s\n" % inst._field_value_text(field)

        return text
637475
function customLog(message) {
  const trimmed = message.trim()
  const limit = trimmed.indexOf('\n')
  if (limit === -1) {
    fancyLog(trimmed)
  } else {
    const title = trimmed.slice(0, limit).trim()
    const details = trimmed.slice(limit).trim()
    fancyLog(`${title}${('\n' + details).replace(/\n/g, '\n  ')}`)
  }
}
601740
def update(self, callback=int):
        """"""
        # print(self._pending_modifications)
        add_var = self._pending_modifications.add_var
        if len(add_var) > 0:
            self._add_variables(add_var)
            self._pending_modifications.add_var = []
        callback()

        add_constr = self._pending_modifications.add_constr
        if len(add_constr) > 0:
            self._add_constraints(add_constr)
            self._pending_modifications.add_constr = []

        add_constr_sloppy = self._pending_modifications.add_constr_sloppy
        if len(add_constr_sloppy) > 0:
            self._add_constraints(add_constr_sloppy, sloppy=True)
            self._pending_modifications.add_constr_sloppy = []

        var_lb = self._pending_modifications.var_lb
        var_ub = self._pending_modifications.var_ub
        if len(var_lb) > 0 or len(var_ub) > 0:
            self._set_variable_bounds_on_problem(var_lb, var_ub)
            self._pending_modifications.var_lb = []
            self._pending_modifications.var_ub = []

        rm_var = self._pending_modifications.rm_var
        if len(rm_var) > 0:
            self._remove_variables(rm_var)
            self._pending_modifications.rm_var = []
        callback()

        rm_constr = self._pending_modifications.rm_constr
        if len(rm_constr) > 0:
            self._remove_constraints(rm_constr)
            self._pending_modifications.rm_constr = []
864395
def _adjust_log_file_override(overrides, default_log_file):
    '''
    
    '''
    if overrides.get('log_dir'):
        # Adjust log_file if a log_dir override is introduced
        if overrides.get('log_file'):
            if not os.path.isabs(overrides['log_file']):
                # Prepend log_dir if log_file is relative
                overrides['log_file'] = os.path.join(overrides['log_dir'],
                                                     overrides['log_file'])
        else:
            # Create the log_file override
            overrides['log_file'] = \
                os.path.join(overrides['log_dir'],
                             os.path.basename(default_log_file))
511690
function(evt) {
    if (evt !== 'change' && evt !== 'rename') {
      return;
    }
    fs.stat(file, function(err, current) {
      if (err) {
        self.logger_.error(err.message);
        self.emit('error.watch', err.message);
        return;
      }
      if (current.size !== prev.size || +current.mtime > +prev.mtime) {
        prev = current; // save new stats
        self.logger_.debug(util.format('%s has been modified', file));
        self.emit('watch');
      }
    });
  }
557966
def log_error(*error, cause=None):
    
    thread_id = threading.current_thread().ident
    text = " ".join(error)
    if cause:
        text += " due to " + str(cause)

    logger = get_logger()
    logger.error(LOG_THREAD_FORMAT.format(thread_id, text))
875589
def generate_changelog(issues, after, heading, rtag=False):
    """"""
    relevent = relevant_issues(issues, after)
    relevent = sorted(relevent, key=ISSUES_BY_SECTION)

    def write(func, endofline="", append=""):
        func(heading + '\n' + '-' * 20 + endofline)
        for section, issue_group in groupby(relevent, key=ISSUES_BY_SECTION):
            func('  * {}:'.format(section) + endofline)
            for issue in reversed(list(issue_group)):
                func('    - {}'.format(issue_line(issue)) + endofline)
        func(endofline + append)

    if rtag is not False:
        with open("../CHANGELOG", "r+") as f:
            content = f.read()
            f.seek(0)
            write(f.write, '\n', content)
    else:
        write(print)
643187
def parse_changelog(args: Any) -> Tuple[str, str]:
    """"""
    with open("CHANGELOG.rst", "r") as file:
        match = re.match(
            pattern=r"(.*?Unreleased\n---+\n)(.+?)(\n*[^\n]+\n---+\n.*)",
            string=file.read(),
            flags=re.DOTALL,
        )
    assert match
    header, changes, tail = match.groups()
    tag = "%s - %s" % (args.tag, datetime.date.today().isoformat())

    tagged = "\n%s\n%s\n%s" % (tag, "-" * len(tag), changes)
    if args.verbose:
        print(tagged)

    return "".join((header, tagged, tail)), changes
1313084
def cli_info(self, event):
        """"""

        self.log('Instance:', self.instance,
                 'Dev:', self.development,
                 'Host:', self.host,
                 'Port:', self.port,
                 'Insecure:', self.insecure,
                 'Frontend:', self.frontendtarget)
1302914
function mark_edited($user_id = 0, $reason = '')
	{
		if($user_id = 0)
		{
			global $user;
			$user_id = $user->data['user_id'];
		}
		$this->post_edit_count++;
		$this->post_edit_time = time();
		$this->post_edit_user = $user_id;
		$this->post_edit_reason = $reason;
	}
449629
public function changelogs()
    {
        foreach (Plugin::all() as $plugin) {
            $file = Plugin::path($plugin, 'CHANGELOG.md', true);

            if ($file) {
                $files[$plugin] = rtr($file);
            }
        }

        $changelog = null;

        //If a changelog file has been specified
        if ($this->request->getQuery('file')) {
            $changelog = file_get_contents(ROOT . DS . $files[$this->request->getQuery('file')]);
        }

        $this->set(compact('changelog', 'files'));
    }
606740
public boolean logModified(Logger log)
  {
    for (int i = _dependencyList.size() - 1; i >= 0; i--) {
      Dependency dependency = _dependencyList.get(i);

      if (dependency.logModified(log))
        return true;
    }

    return false;
  }
226577
function (latest_log) {
		if (latest_log !== null && latest_log.type !== "SYSTEM_DOWN") {
			LOG.warn("server crashed last time", 'handlers.system');
			LOG.event("SYSTEM_CRASHED", SR.Settings.SERVER_INFO);
		}

		LOG.event("SYSTEM_UP", SR.Settings.SERVER_INFO);
	}
161213
def last_modified(self, last_modified):
        """"""
        self._indicator_data['lastModified'] = self._utils.format_datetime(
            last_modified, date_format='%Y-%m-%dT%H:%M:%SZ'
        )