本文整理汇总了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 { }
}
示例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);
}
示例3: checkLevelUnlocked
/**
* Returns true if level unlocked
*/
public bool checkLevelUnlocked(Level level)
{
if (PlayerPrefs.GetString (level.ToString ()).Equals ("Unlocked"))
return true;
else
return false;
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例9: LoadLevel
protected void LoadLevel(Level level)
{
if (!Fadeout)
{
Application.LoadLevel(level.ToString());
}
else if (!_added)
{
gameObject.AddComponent<FadeoutAnimation>().NextLevel = level;
_added = true;
}
}
示例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();
}
示例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();
}
}
示例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 ());
}
示例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);
}
示例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);
}
}
示例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));
}