// LoginUser logs in a user
557806
func LoginUser(host, token string, doc map[string]interface{}) (*map[string]interface{}, error) {
	path := variables.APIPathLoginUser
	return GenericRequest(host, path, token, doc)
}
1162604
func logger(ww *ResponseWriter, r *http.Request) {
	log.Printf("%s [%s] %d %d %s %s",
		r.RemoteAddr,
		r.URL,
		ww.Status(),
		ww.Size(),
		ww.RequestTime(),
		ww.RequestID())
}
673218
func (b *Builder) Logger(logger log.Logger) *Builder {
	b.logger = logger
	return b
}
904866
func Logger() HandlerFunc {
	l := &logger{log.New(os.Stdout, "[ace] ", 0)}

	return func(c *C) {
		start := time.Now()
		c.Next()

		l.Printf("%s %s %v %s in %v", c.Request.Method, c.Request.URL.Path, c.Writer.Status(), http.StatusText(c.Writer.Status()), time.Since(start))
	}
}
1141694
func (aug *AuthUserGroup) AuthUser(db XODB) (*AuthUser, error) {
	return AuthUserByID(db, aug.UserID)
}
569813
func (service *Service) GetLoggedInUser(request *http.Request, w http.ResponseWriter) (username string, err error) {
	authenticatedSession, err := service.GetSession(request, SessionInteractive, "authenticatedsession")
	if err != nil {
		log.Error(err)
		return
	}
	err = authenticatedSession.Save(request, w)
	if err != nil {
		log.Error(err)
		return
	}
	savedusername := authenticatedSession.Values["username"]
	if savedusername != nil {
		username, _ = savedusername.(string)
	}
	return
}
285198
func Logger(logger *zap.Logger) TransportOption {
	return func(options *transportOptions) {
		options.logger = logger
	}
}
1067779
func (o *Ownership) IsOwner(user *auth.UserInfo) bool {
	return o.Owner == user.Username
}
423490
func Logger(logger *zap.Logger) TransportOption {
	return func(transportOptions *transportOptions) {
		transportOptions.logger = logger
	}
}
578690
func (log *impl) AuditErr(msg string) {
	log.auditAtLevel(syslog.LOG_ERR, msg)
}
354339
func NewLogger(f *Fibre) *Logger {

	return &Logger{&logrus.Logger{
		Out:       os.Stderr,
		Level:     logrus.ErrorLevel,
		Hooks:     make(logrus.LevelHooks),
		Formatter: new(logrus.TextFormatter),
	}}

}
623866
func (samplerOptions) Logger(logger Logger) SamplerOption {
	return func(o *samplerOptions) {
		o.logger = logger
	}
}
1111129
func (r Notification_User_Subscriber_Preference) GetNotificationUserSubscriber() (resp datatypes.Notification_User_Subscriber, err error) {
	err = r.Session.DoRequest("SoftLayer_Notification_User_Subscriber_Preference", "getNotificationUserSubscriber", nil, &r.Options, &resp)
	return
}
24528
func InitLogger() {
	if !flag.Parsed() {
		flag.Parse()
	}
	if env_level,ok := os.LookupEnv("LOGGER_LEVEL");ok{
		*flagLoggerLevel = env_level
	}
	SetDefaultLevel("/", getLevel(*flagLoggerLevel))
	Info("设置默认日志级别为:%s", *flagLoggerLevel)
}
311871
func buildInternalNkeyUser(uc *jwt.UserClaims, acc *Account) *NkeyUser {
	nu := &NkeyUser{Nkey: uc.Subject, Account: acc}
	if uc.IssuerAccount != "" {
		nu.SigningKey = uc.Issuer
	}

	// Now check for permissions.
	var p *Permissions

	if len(uc.Pub.Allow) > 0 || len(uc.Pub.Deny) > 0 {
		if p == nil {
			p = &Permissions{}
		}
		p.Publish = &SubjectPermission{}
		p.Publish.Allow = uc.Pub.Allow
		p.Publish.Deny = uc.Pub.Deny
	}
	if len(uc.Sub.Allow) > 0 || len(uc.Sub.Deny) > 0 {
		if p == nil {
			p = &Permissions{}
		}
		p.Subscribe = &SubjectPermission{}
		p.Subscribe.Allow = uc.Sub.Allow
		p.Subscribe.Deny = uc.Sub.Deny
	}
	nu.Permissions = p
	return nu
}
494591
func IsAdminUser(c context.Context) error {
	cfg, err := GetConfigProvider(c).Config(c)
	if err != nil {
		return err
	}
	return checkMember(c, cfg.Coordinator.AdminAuthGroup)
}
927819
func NewLogger(token string, opt LoggerOptions) (instance *LoggerType, err error) {
	opt.check()
	client := slack.New(token)
	if _, err = client.AuthTest(); err != nil {
		err = ErrSlackAuthTestFailed.New(err)
		return
	}

	ctx, cancel := context.WithCancel(opt.Context)
	eg, ctx := errgroup.WithContext(ctx)
	opt.Context = ctx

	logger := &LoggerType{
		token:        token,
		options:      opt,
		client:       client,
		messageQueue: make(chan messageType, opt.MessageQueueSize),
		eg:           eg,
		cancel:       cancel,
	}

	if !opt.Sync {
		for i := 0; i < opt.Worker; i++ {
			eg.Go(func() error {
				logger.workerLoop()
				return nil
			})
		}
	}

	return logger, nil
}