using debug log level to print StackTrace

This commit is contained in:
huiyadanli
2024-01-09 23:42:00 +08:00
parent c0171f7874
commit 2f29ab7fae
6 changed files with 13 additions and 11 deletions

View File

@@ -8,7 +8,7 @@ public partial class AutoDomainConfig : ObservableObject
{
/// <summary>
/// 战斗结束后延迟几秒再开始寻找石化古树
/// 战斗结束后延迟几秒再开始寻找石化古树,秒
/// </summary>
[ObservableProperty] private int _fightEndDelay = 5000;
[ObservableProperty] private double _fightEndDelay = 5;
}

View File

@@ -103,7 +103,7 @@ public class AutoDomainTask
}
catch (Exception e)
{
Logger.LogInformation(e.Message);
Logger.LogError(e.Message);
Logger.LogDebug(e.StackTrace);
}
finally
@@ -296,11 +296,11 @@ public class AutoDomainTask
return;
}
var ms = TaskContext.Instance().Config.AutoDomainConfig.FightEndDelay;
if (ms > 0)
var s = TaskContext.Instance().Config.AutoDomainConfig.FightEndDelay;
if (s > 0)
{
Sleep(1000, _taskParam.Cts);
Logger.LogInformation("战斗结束后等待 {Ms} 毫秒", ms);
Logger.LogInformation("战斗结束后等待 {Second} 秒", s);
Sleep((int)(s * 1000), _taskParam.Cts);
}
}

View File

@@ -67,7 +67,8 @@ public class AutoFightTask
}
catch (Exception e)
{
Logger.LogInformation(e.Message);
Logger.LogError(e.Message);
Logger.LogDebug(e.StackTrace);
}
finally
{

View File

@@ -306,7 +306,7 @@ public class Duel
catch (System.Exception ex)
{
_logger.LogError(ex.Message);
Debug.WriteLine(ex.StackTrace);
_logger.LogDebug(ex.StackTrace);
if (TaskContext.Instance().Config.DetailedErrorLogs)
{
_logger.LogError(ex.StackTrace);

View File

@@ -86,7 +86,8 @@ public class AutoWoodTask
}
catch (Exception e)
{
Logger.LogInformation(e.Message);
Logger.LogError(e.Message);
Logger.LogDebug(e.StackTrace);
System.Windows.MessageBox.Show("自动伐木时异常:" + e.Source + "\r\n--" + Environment.NewLine + e.StackTrace + "\r\n---" + Environment.NewLine + e.Message);
}
finally

View File

@@ -457,7 +457,7 @@
<ui:TextBlock Grid.Row="0"
Grid.Column="0"
FontTypography="Body"
Text="战斗完成后等待时间(秒)"
Text="战斗完成后等待时间(秒)"
TextWrapping="Wrap" />
<ui:TextBlock Grid.Row="1"
Grid.Column="0"