本文整理汇总了C#中DebugLevel类的典型用法代码示例。如果您正苦于以下问题:C# DebugLevel类的具体用法?C# DebugLevel怎么用?C# DebugLevel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DebugLevel类属于命名空间,在下文中一共展示了DebugLevel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1:
void IPhotonPeerListener.DebugReturn(DebugLevel debugLevel, string debug)
{
if (log.IsDebugEnabled)
{
// we do not use debugLevel here - just log whatever debug we have
log.DebugFormat(debug);
}
}
示例2: Log
private static void Log(DebugLevel priority, string tag, string msg)
{
var logger = AxolotlLoggerProvider.GetProvider();
if (logger != null) {
logger.Log(priority, tag, msg);
}
}
示例3: LogStringWithTimeStamp
public void LogStringWithTimeStamp(string str, DebugLevel debugLevel)
{
StreamWriter stream = StreamSelector (debugLevel);
if (stream != null) {
stream.WriteLine ("{0} : [{1}] {2}", TimeStamp(), debugLevel.ToString(), str);
stream.Flush ();
}
}
示例4: LogStringWithPrefix
public void LogStringWithPrefix(string str, string prefix, DebugLevel debugLevel)
{
StreamWriter stream = StreamSelector (debugLevel);
if (stream != null) {
stream.WriteLine ("{0}{1}", prefix, str);
stream.Flush ();
}
}
示例5: Factory
/// <summary>
/// Default Constructor for a <see cref = "SharpDX.Direct2D1.Factory" />.
/// </summary>
public Factory(FactoryType factoryType, DebugLevel debugLevel)
: base(IntPtr.Zero)
{
FactoryOptions? options = null;
if (debugLevel != DebugLevel.None)
options = new FactoryOptions() { DebugLevel = debugLevel };
IntPtr temp;
D2D1.CreateFactory(factoryType, Utilities.GetGuidFromType(GetType()), options, out temp);
FromTemp(temp);
}
示例6: ToFile
public static void ToFile(DebugLevel level, string message)
{
//Directory.CreateDirectory("Logs");
//StreamWriter file = new StreamWriter(
// LOGFILE,
// File.Exists(LOGFILE));
//file.WriteLine("[" + DateTime.Now.ToString() + "] " +
// level.ToString() + ": " + message + "\n");
//file.Close();
}
示例7: Debug_DebugHandler
private void Debug_DebugHandler(string arg1, DebugLevel arg2)
{
switch (arg2)
{
case DebugLevel.Info:
UnityEngine.Debug.Log(arg1);
break;
case DebugLevel.Warning:
UnityEngine.Debug.LogWarning(arg1);
break;
case DebugLevel.Error:
UnityEngine.Debug.LogError(arg1);
break;
}
}
示例8: Debug_DebugHandler
private static void Debug_DebugHandler(string arg1, DebugLevel arg2)
{
var consoleForegroundColorCashe = Console.ForegroundColor;
switch (arg2)
{
case DebugLevel.Info:
Console.ForegroundColor = ConsoleColor.White;
break;
case DebugLevel.Warning:
Console.ForegroundColor = ConsoleColor.Yellow;
break;
case DebugLevel.Error:
Console.ForegroundColor = ConsoleColor.Red;
break;
}
Console.WriteLine(arg1);
Console.ForegroundColor = consoleForegroundColorCashe;
}
示例9: Debug
//string Prefix = ""
//public static void Debug(string content, DebugLevel level = DebugLevel.Info,
// Output way = Output.Console, MenuItem DebugMenu = null)
//{
// if (DebugMenu != null && !DebugMenu.GetValue<bool>()) return;
// if (way == Output.Console)
// {
// ConsoleColor color = ConsoleColor.White;
// if (level == DebugLevel.Info)
// {
// color = ConsoleColor.Green;
// }
// else if (level == DebugLevel.Warning)
// {
// color = ConsoleColor.Yellow;
// }
// else if (level == DebugLevel.Wrang)
// {
// color = ConsoleColor.Red;
// }
// Console.ForegroundColor = color;
// Console.WriteLine(content);
// Console.ForegroundColor = ConsoleColor.White;
// }
// else if(way == Output.ChatBox)
// {
// System.Drawing.Color color = System.Drawing.Color.White;
// if (level == DebugLevel.Info)
// {
// color = System.Drawing.ColorTranslator.FromHtml("#AAAAFF");
// }
// else if (level == DebugLevel.Warning)
// {
// color = System.Drawing.Color.Orange;
// }
// else if (level == DebugLevel.Wrang)
// {
// color = System.Drawing.Color.Red;
// }
// Game.PrintChat(content.ToHtml(color, FontStlye.Cite));
// }
//}
public static void Debug(string content, DebugLevel level = DebugLevel.Info,
Output way = Output.Console, bool enable = true)
{
if (!enable) return;
if (way == Output.Console)
{
ConsoleColor color = ConsoleColor.White;
if (level == DebugLevel.Info)
{
color = ConsoleColor.Green;
}
else if (level == DebugLevel.Warning)
{
color = ConsoleColor.Yellow;
}
else if (level == DebugLevel.Wrang)
{
color = ConsoleColor.Red;
}
Console.ForegroundColor = color;
Console.WriteLine(content);
Console.ForegroundColor = ConsoleColor.White;
}
else if (way == Output.ChatBox)
{
System.Drawing.Color color = System.Drawing.Color.White;
if (level == DebugLevel.Info)
{
color = System.Drawing.ColorTranslator.FromHtml("#AAAAFF");
}
else if (level == DebugLevel.Warning)
{
color = System.Drawing.Color.Orange;
}
else if (level == DebugLevel.Wrang)
{
color = System.Drawing.Color.Red;
}
Game.PrintChat(content.ToHtml(color, FontStlye.Cite));
}
}
示例10: Write
public static void Write(string Prefix, string content, DebugLevel level = DebugLevel.Info,
WriteWay way = WriteWay.Console, bool enable = true)
{
if (!enable) return;
if (way == WriteWay.Console)
{
ConsoleColor color = ConsoleColor.White;
if (level == DebugLevel.Info)
{
color = ConsoleColor.DarkGreen;
}
else if (level == DebugLevel.Warning)
{
color = ConsoleColor.Yellow;
}
else if (level == DebugLevel.Wrang)
{
color = ConsoleColor.Red;
}
Console.ForegroundColor = color;
Console.WriteLine(!string.IsNullOrEmpty(Prefix) ? (Prefix + ":"+ content) : "" + content);
Console.ForegroundColor = ConsoleColor.White;
}
else
{
System.Drawing.Color color = System.Drawing.Color.White;
if (level == DebugLevel.Info)
{
color = System.Drawing.ColorTranslator.FromHtml("#AAAAFF");
}
else if (level == DebugLevel.Warning)
{
color = System.Drawing.Color.Orange;
}
else if (level == DebugLevel.Wrang)
{
color = System.Drawing.Color.Red;
}
content = (string.IsNullOrEmpty(Prefix) ? (Prefix + ":") : "") + content;
Game.PrintChat(content.ToHtml(color, FontStlye.Cite));
}
}
示例11: DebugReturn
public void DebugReturn(DebugLevel level, string message)
{
if (level == DebugLevel.ERROR)
{
Debug.LogError(message);
}
else if (level == DebugLevel.WARNING)
{
Debug.LogWarning(message);
}
else if (level == DebugLevel.INFO && PhotonNetwork.logLevel >= PhotonLogLevel.Informational)
{
Debug.Log(message);
}
else if (level == DebugLevel.ALL && PhotonNetwork.logLevel == PhotonLogLevel.Full)
{
Debug.Log(message);
}
}
示例12: Debug
public static void Debug(string content, DebugLevel level = DebugLevel.Info, Output way = Output.Console) {
if (way == Output.Console)
{
ConsoleColor color = ConsoleColor.White;
if (level == DebugLevel.Info)
{
color = ConsoleColor.Green;
}
else if (level == DebugLevel.Warning)
{
color = ConsoleColor.Yellow;
}
else if (level == DebugLevel.Wrang)
{
color = ConsoleColor.Red;
}
Console.ForegroundColor = color;
Console.WriteLine("AS锤石:" + content);
Console.ForegroundColor = ConsoleColor.White;
}
else if(Thresh.Config.Item("调试").GetValue<bool>())
{
System.Drawing.Color color = System.Drawing.Color.White;
if (level == DebugLevel.Info)
{
color = System.Drawing.ColorTranslator.FromHtml("#AAAAFF");
}
else if (level == DebugLevel.Warning)
{
color = System.Drawing.Color.Orange;
}
else if (level == DebugLevel.Wrang)
{
color = System.Drawing.Color.Red;
}
}
}
示例13: DialVoice
public string DialVoice(string number, bool showNumber, int gammuRcSection, DebugLevel debugLevel)
{
if (number == null) throw new ArgumentNullException("number");
try{
//_sm.DialVoice(number);
var con = _sm.Contacts;
}
catch (GammuException ex)
{
throw new FaultException<GammuErrInfo> (new GammuErrInfo
{
ErrorCode = ex.ErrorCode,
Message = ex.Text
});
}
return string.Format("Dial number {0}With result ", number) ;
}
示例14: DebugReturn
public void DebugReturn(DebugLevel level, string message)
{
this.externalListener.DebugReturn(level, message);
}
示例15: DebugReturn
public void DebugReturn(DebugLevel level, string message)
{
Debug.Log(message);
}