示例#1
0
        public MessageResult TestLog([FromServices] ILogger <LogReporterApi> logger)
        {
            var logLevels = Enum.GetValues <LogLevel>();

            foreach (var logLevel in logLevels)
            {
                logger.Log(logLevel, $"test log for {logLevel} ({(int)logLevel})");
            }
            return(MessageResult.CreateSuccess("OK"));
        }
示例#2
0
        public MessageResult GetIgnoreLogs()
        {
            var ignoreCaches = RemoteIgnoreLoggers.Instance.GetIgnoreCaches();
            var items        = new List <string>();

            foreach (var item in ignoreCaches)
            {
                items.Add(item.Value ? $"{item.Key} ignored!" : $"{item.Key} not ignored.");
            }
            var messageResult = MessageResult.CreateSuccess("OK");

            messageResult.Data = items.OrderBy(x => x);
            return(messageResult);
        }
 public MessageResult SmartOp()
 {
     return(MessageResult.CreateSuccess("SmartOp", _currentUser.ToString()));
 }
 public MessageResult Fallback()
 {
     return(MessageResult.CreateSuccess("Fallback", _currentUser.ToString()));
 }
 public MessageResult NeedLeader()
 {
     return(MessageResult.CreateSuccess("NeedLeader", _currentUser.ToString()));
 }
 public MessageResult NeedAdmin()
 {
     return(MessageResult.CreateSuccess("NeedAdmin", _currentUser.ToString()));
 }
        public async Task <MessageResult> NeedLogin()
        {
            var accessToken = await HttpContext.GetTokenAsync("access_token");

            return(MessageResult.CreateSuccess("NeedLogin", _currentUser.ToString()));
        }
 public MessageResult Anonymous()
 {
     return(MessageResult.CreateSuccess("Anonymous", _currentUser.ToString()));
 }