Show log overview for the current user
179570
public function overviewAction()
    {
        if ($this->overviewSnippets) {
            $params = $this->_processParameters($this->overviewParameters);

            $this->addSnippets($this->overviewSnippets, $params);
        }
    }
480206
def show():
    
    utils.check_for_cloud_server()
    click.echo("Using cloud server at \"{}\"".format(
        config["cloud_server"]["url"]
    ))
    if config["cloud_server"]["username"]:
        click.echo(
            "Logged in as user \"{}\"".format(config["cloud_server"]["username"])
        )
    if config["cloud_server"]["farm_name"]:
        click.echo(
            "Using farm \"{}\"".format(config["cloud_server"]["farm_name"])
        )
441644
def show(config_file=False):
    '''
    
    '''
    roots = (
        'kern',
        'vm',
        'vfs',
        'net',
        'hw',
        'machdep',
        'user',
        'ddb',
        'proc',
        'emul',
        'security',
        'init'
    )
    cmd = 'sysctl -ae'
    ret = {}
    out = __salt__['cmd.run'](cmd, output_loglevel='trace')
    comps = ['']
    for line in out.splitlines():
        if any([line.startswith('{0}.'.format(root)) for root in roots]):
            comps = re.split('[=:]', line, 1)
            ret[comps[0]] = comps[1]
        elif comps[0]:
            ret[comps[0]] += '{0}\n'.format(line)
        else:
            continue
    return ret
182918
def details(self):
        """"""
        return self.dest_user.profile.details.convert_and_update(
            self.source_profile.details.as_dict
        )
528162
def log_status (self):
        """"""
        duration = time.time() - self.start_time
        checked, in_progress, queue = self.aggregator.urlqueue.status()
        num_urls = len(self.aggregator.result_cache)
        self.logger.log_status(checked, in_progress, queue, duration, num_urls)
982978
def demonstrate_colored_logging():
    """"""
    # Determine the available logging levels and order them by numeric value.
    decorated_levels = []
    defined_levels = coloredlogs.find_defined_levels()
    normalizer = coloredlogs.NameNormalizer()
    for name, level in defined_levels.items():
        if name != 'NOTSET':
            item = (level, normalizer.normalize_name(name))
            if item not in decorated_levels:
                decorated_levels.append(item)
    ordered_levels = sorted(decorated_levels)
    # Initialize colored output to the terminal, default to the most
    # verbose logging level but enable the user the customize it.
    coloredlogs.install(level=os.environ.get('COLOREDLOGS_LOG_LEVEL', ordered_levels[0][1]))
    # Print some examples with different timestamps.
    for level, name in ordered_levels:
        log_method = getattr(logger, name, None)
        if log_method:
            log_method("message with level %s (%i)", name, level)
            time.sleep(DEMO_DELAY)
284740
def show_view(self):
        
        self.current.output['login_process'] = True
        if self.current.is_auth:
            self._do_upgrade()
        else:
            self.current.output['forms'] = LoginForm(current=self.current).serialize()
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
554995
def admin_log(instances, msg: str, who: User=None, **kw):
    

    from django.contrib.admin.models import LogEntry, CHANGE
    from django.contrib.admin.options import get_content_type_for_model
    from django.utils.encoding import force_text

    # use system user if 'who' is missing
    if not who:
        username = settings.DJANGO_SYSTEM_USER if hasattr(settings, 'DJANGO_SYSTEM_USER') else 'system'
        who, created = User.objects.get_or_create(username=username)

    # append extra keyword attributes if any
    att_str = ''
    for k, v in kw.items():
        if hasattr(v, 'pk'):  # log only primary key for model instances, not whole str representation
            v = v.pk
        att_str += '{}={}'.format(k, v) if not att_str else ', {}={}'.format(k, v)
    if att_str:
        att_str = ' [{}]'.format(att_str)
    msg = str(msg) + att_str

    if not isinstance(instances, list) and not isinstance(instances, tuple):
        instances = [instances]
    for instance in instances:
        if instance:
            LogEntry.objects.log_action(
                user_id=who.pk,
                content_type_id=get_content_type_for_model(instance).pk,
                object_id=instance.pk,
                object_repr=force_text(instance),
                action_flag=CHANGE,
                change_message=msg,
            )
471910
def showDetails(self):
        
        msg = self.currentItem().data(QtCore.Qt.UserRole)
        desc = msg.description
        desc = desc.replace('\r\n', '\n').replace('\r', '\n')
        desc = desc.replace('\n', '<br/>')
        QtWidgets.QMessageBox.information(
            self, _('Message details'),
            _("""<p><b>Description:</b><br/>%s</p>
<p><b>File:</b><br/>%s</p>
<p><b>Line:</b><br/>%d</p>
            """) % (desc, msg.path, msg.line + 1, ))
1039262
def cli(obj, show_userinfo):
    """"""
    client = obj['client']
    userinfo = client.userinfo()
    if show_userinfo:
        for k, v in userinfo.items():
            if isinstance(v, list):
                v = ', '.join(v)
            click.echo('{:20}: {}'.format(k, v))
    else:
        click.echo(userinfo['preferred_username'])
1342225
def viewlog(calc_id, host='localhost', port=8000):
    
    base_url = 'http://%s:%s/v1/calc/' % (host, port)
    start = 0
    psize = 10  # page size
    try:
        while True:
            url = base_url + '%d/log/%d:%d' % (calc_id, start, start + psize)
            rows = json.load(urlopen(url))
            for row in rows:
                print(' '.join(row))
            start += len(rows)
            time.sleep(1)
    except:
        pass
705026
def show_detailed_monitoring(name=None, instance_id=None, call=None, quiet=False):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The show_detailed_monitoring action must be called with -a or --action.'
        )
    location = get_location()
    if six.text_type(name).startswith('i-') and (len(name) == 10 or len(name) == 19):
        instance_id = name

    if not name and not instance_id:
        raise SaltCloudSystemExit(
            'The show_detailed_monitoring action must be provided with a name or instance\
 ID'
        )
    matched = _get_node(name=name, instance_id=instance_id, location=location)
    log.log(
        logging.DEBUG if quiet is True else logging.INFO,
        'Detailed Monitoring is %s for %s', matched['monitoring'], name
    )
    return matched['monitoring']
894414
protected function displaySummary($logs)
	{
		$stack=array();
		$results=array();
		foreach($logs as $log)
		{
			if($log[1]!==CLogger::LEVEL_PROFILE)
				continue;
			$message=$log[0];
			if(!strncasecmp($message,'begin:',6))
			{
				$log[0]=substr($message,6);
				$stack[]=$log;
			}
			elseif(!strncasecmp($message,'end:',4))
			{
				$token=substr($message,4);
				if(($last=array_pop($stack))!==null && $last[0]===$token)
				{
					$delta=$log[3]-$last[3];
					if(!$this->groupByToken)
						$token=$log[2];
					if(isset($results[$token]))
						$results[$token]=$this->aggregateResult($results[$token],$delta);
					else
						$results[$token]=array($token,1,$delta,$delta,$delta);
				}
				else
					throw new CException(Yii::t('yii','CProfileLogRoute found a mismatching code block "{token}". Make sure the calls to Yii::beginProfile() and Yii::endProfile() be properly nested.',
						array('{token}'=>$token)));
			}
		}

		$now=microtime(true);
		while(($last=array_pop($stack))!==null)
		{
			$delta=$now-$last[3];
			$token=$this->groupByToken ? $last[0] : $last[2];
			if(isset($results[$token]))
				$results[$token]=$this->aggregateResult($results[$token],$delta);
			else
				$results[$token]=array($token,1,$delta,$delta,$delta);
		}

		$entries=array_values($results);
		usort($entries, array($this, 'resultEntryCompare'));

		$this->render('profile-summary',$entries);
	}
451407
def user_recent(self):
        '''
        
        '''
        kwd = {
            'pager': '',
            'title': ''
        }
        self.render('user/info_list/user_recent.html',
                    kwd=kwd,
                    user_name=self.get_current_user(),
                    userinfo=self.userinfo)
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);
	}
813674
def user_save_event(user):
    
    msg = 'User ({}){} updated/saved'.format(user.id, user.email)
    current_app.logger.info(msg)