当前位置: 首页>>代码示例>>C#>>正文


C# Level.ToString方法代码示例

本文整理汇总了C#中Level.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Level.ToString方法的具体用法?C# Level.ToString怎么用?C# Level.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Level的用法示例。


在下文中一共展示了Level.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Write

 void Write(Level level, string text, Exception exception = null)
 {
     try
     {
         if (exception == null)
         {
             _logStatements.Insert(new
             {
                 level = level.ToString(),
                 text = text,
                 time = DateTime.Now,
                 owner = _ownerType.FullName
             }, WriteConcern.Unacknowledged);
         }
         else
         {
             _logStatements.Insert(new
             {
                 level = level.ToString(),
                 text = text,
                 time = DateTime.Now,
                 owner = _ownerType.FullName,
                 exception = exception.ToString()
             }, WriteConcern.Unacknowledged);
         }
     }
     catch { }
 }
开发者ID:RichieYang,项目名称:Cirqus,代码行数:28,代码来源:MongoDbLoggerFactory.cs

示例2: Log

 public void Log(Level l, string s)
 {
     StringLogs.Add(s);
     LevelLogs.Add(l);
     LogEvent.Invoke(l, s);
     DebugMessageHandler.AssertCl("["+l.ToString().ToUpper()+"] " + s);
 }
开发者ID:seaboy1234,项目名称:Minecraft-Mod-Updater,代码行数:7,代码来源:Logger.cs

示例3: checkLevelUnlocked

 /**
  * Returns true if level unlocked
  */
 public bool checkLevelUnlocked(Level level)
 {
     if (PlayerPrefs.GetString (level.ToString ()).Equals ("Unlocked"))
         return true;
     else
         return false;
 }
开发者ID:dulb640,项目名称:angrygoats,代码行数:10,代码来源:LevelManager.cs

示例4: Write

 public void Write(Level level, string message, Exception ex)
 {
     Console.Write("{0}  {1} ", DateTime.Now.ToShortDateString(), DateTime.Now.ToLongTimeString());
     Console.Write("{0} - {1}", level.ToString(), message);
     if (ex != null)
     {
         Console.WriteLine(" - {0}", ex.Message);
     }
 }
开发者ID:daniel9992000,项目名称:Backoffice,代码行数:9,代码来源:ConsoleAppender.cs

示例5: write

 private void write(Level logLevel, String text)
 {
     try {
         this.log.WriteLine("[" + TimeUtils.getTime() + "] [" + logLevel.ToString() + "] " + text);
         this.log.Flush();
     } catch (IOException e) {
         //print to console -- there's not really much you can do about it
         Console.WriteLine(e.Message);
     }
 }
开发者ID:TheLunarFrog,项目名称:PlayerTracker-1,代码行数:10,代码来源:Logger.cs

示例6: DoLog

        private void DoLog(Level myLevel, string myMessage, object[] myParams)
        {
            if (myLevel > _Level)
                return;

            myMessage = (myParams == null)
                ? myMessage
                : String.Format(myMessage, myParams);

            _stream.WriteLine(DateTime.Now + " " + myLevel.ToString() + ": " + myMessage);
        }
开发者ID:anukat2015,项目名称:sones,代码行数:11,代码来源:FileLogger.cs

示例7: LogInfo

 /// <summary>
 /// 记录日志文件
 /// </summary>
 /// <param name="log">日志信息</param>
 /// <param name="level">日志级别(默认为正常信息)</param>
 public void LogInfo(string logString, Level level = Level.INFO)
 {
     int _level = (int)AD.Core.ViewModel.Context.Global.LogLevel;
     int l = (int)level;
     if (l < _level)
     {
         return;
     }
     logString = level.ToString() + ":     " + logString + "\r\n";
     log(logString, name);
 }
开发者ID:wangjianglin,项目名称:dotnet-core,代码行数:16,代码来源:Log.cs

示例8: Write

 public void Write(Level level, string message, Exception ex)
 {
     using (StreamWriter sw = File.AppendText(filename))
     {
         sw.Write("{0}  {1} ", DateTime.Now.ToShortDateString(), DateTime.Now.ToLongTimeString());
         sw.Write("{0} - {1}", level.ToString(), message);
         if (ex != null)
         {
             sw.WriteLine(" - {0}", ex.Message);
         }
     }
 }
开发者ID:daniel9992000,项目名称:Backoffice,代码行数:12,代码来源:FileAppender.cs

示例9: LoadLevel

    protected void LoadLevel(Level level)
    {
        if (!Fadeout)
        {
            Application.LoadLevel(level.ToString());
        }
        else if (!_added)
        {
            gameObject.AddComponent<FadeoutAnimation>().NextLevel = level;

            _added = true;
        }
    }
开发者ID:Tridimensional,项目名称:Tridimensional.Maze,代码行数:13,代码来源:Controller.cs

示例10: FilterExercises

        public void FilterExercises(string nameToFilterOn, Level levelToFilterOn)
        {
            WebDriver.FindElement(By.Id("filterToggle")).Click();

            WebDriver.FindElement(By.Id("NameFilter")).SendKeysWhenElementDisplayed(nameToFilterOn);

            WebDriver.FindElement(By.Id("LevelFilter")).SendKeys(levelToFilterOn.ToString());

            WebDriver.FindElement(By.Id("filterSubmit")).Click();

            AwaitLoad();
            OnPageLoaded();
        }
开发者ID:JWroe,项目名称:HEWFitness,代码行数:13,代码来源:ExercisePage.cs

示例11: Log

        public static void Log(Level level, EventType type, EventAction action, string data)
        {
            using (ApplicationDbContext dbContext = ApplicationDbContext.Create())
            {
                AuditLogModel logModel = new AuditLogModel();
                logModel.Level = level.ToString();
                logModel.EventType = type.ToString();
                logModel.EventAction = action.ToString();
                logModel.Data = data;
                logModel.UTC = DateTime.UtcNow;

                dbContext.Entry(logModel).State = EntityState.Added;
                dbContext.SaveChanges();
            }
        }
开发者ID:exactsync,项目名称:ExactSync,代码行数:15,代码来源:AuditLogService.cs

示例12: Write

        public static void Write(string tag, string message, Level level = Level.Information)
        {
            if (VerbosityLevel > level)
                return;

            var str = new StringBuilder ();
            str.Append ("(");
            str.Append (level.ToString ());
            str.Append (") ");
            str.Append ("[");
            str.Append (tag);
            str.Append ("] ");
            str.Append (message);
            Console.WriteLine (str.ToString ());
        }
开发者ID:rockyhe,项目名称:MojioTowingAlert,代码行数:15,代码来源:MyLogger.cs

示例13: WriteLine

        public static void WriteLine(Level level, string s, params object[] args)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("{0},{1} ", level.ToString(), DateTime.Now.ToString());

            if (args.Length == 0)
                sb.Append(s);
            else
                sb.AppendFormat(s, args);

            string sLine = sb.ToString();

            if (level != Level.info)
                Console.Error.WriteLine(sLine);
            else
                Console.WriteLine(sLine);

            if (s_sw != null)
                s_sw.WriteLine(sLine);

        }
开发者ID:zhongkaifu,项目名称:AdvUtils,代码行数:21,代码来源:Logger.cs

示例14: WriteLog

 /// <summary>
 /// Write the ErrorMessage in EventLog Table on xdGlobal Database
 /// </summary>
 /// <param name="Message">Error Message</param>
 /// <param name="objSource">Source Component</param>
 /// <param name="level">Logging Level</param>
 private void WriteLog(object message, object source, Level level)
 {
     try
     {
         using (DbManager db = DbManager.GetDbManager())
         {
             SqlParameter[] parameters = new SqlParameter[]
             {
                   db.MakeInParam("@ErrorNumber", SqlDbType.Int, -1, 0)
                 , db.MakeInParam("@ErrorSeverity ", SqlDbType.VarChar, 300, level.ToString())
                 , db.MakeInParam("@ErrorState", SqlDbType.Int, 0, Convert.ToInt32( level))
                 , db.MakeInParam("@ErrorProcedure", SqlDbType.VarChar, 175, (source ?? "").ToString())
                 , db.MakeInParam("@ErrorLine", SqlDbType.Int, 0, 0)
                 , db.MakeInParam("@ErrorMessage ", SqlDbType.VarChar, 900,message.ToString())
             };
             db.RunProc("up_insertApplicationLog", parameters);
         }
     }
     catch (Exception ex)
     {
         System.Diagnostics.Trace.WriteLine("Unable to write LOG in SQL" + ex.Message);
     }
 }
开发者ID:AsmaBabarISL,项目名称:Epr_General,代码行数:29,代码来源:SqlLog.cs

示例15: LogMessage

 public override void LogMessage(Level level, string logger, string message)
 {
     SetForeGroundColor(level);
     Console.WriteLine(string.Format("[{0}] [{1}]: {2}", level.ToString().PadLeft(5), logger, message));
 }
开发者ID:Sanchen,项目名称:mooege,代码行数:5,代码来源:TinyLogger.cs


注:本文中的Level.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。