Show shardid in logs
This commit is contained in:
parent
8fff510dc7
commit
fb85f0c397
@ -160,7 +160,7 @@ namespace NadekoBot.Core.Services
|
||||
|
||||
private Task LogSuccessfulExecution(IUserMessage usrMsg, ITextChannel channel, params int[] execPoints)
|
||||
{
|
||||
_log.Info("Command Executed after " + string.Join("/", execPoints.Select(x => x * _oneThousandth)) + "s\n\t" +
|
||||
_log.Info($"S: {_client.ShardId} | Command Executed after " + string.Join("/", execPoints.Select(x => x * _oneThousandth)) + "s\n\t" +
|
||||
"User: {0}\n\t" +
|
||||
"Server: {1}\n\t" +
|
||||
"Channel: {2}\n\t" +
|
||||
@ -175,7 +175,7 @@ namespace NadekoBot.Core.Services
|
||||
|
||||
private void LogErroredExecution(string errorMessage, IUserMessage usrMsg, ITextChannel channel, params int[] execPoints)
|
||||
{
|
||||
_log.Warn("Command Errored after " + string.Join("/", execPoints.Select(x => x * _oneThousandth)) + "s\n\t" +
|
||||
_log.Warn($"S: {_client.ShardId} | Command Errored after " + string.Join("/", execPoints.Select(x => x * _oneThousandth)) + "s\n\t" +
|
||||
"User: {0}\n\t" +
|
||||
"Server: {1}\n\t" +
|
||||
"Channel: {2}\n\t" +
|
||||
|
@ -6,12 +6,12 @@ namespace NadekoBot.Core.Services
|
||||
{
|
||||
public class LogSetup
|
||||
{
|
||||
public static void SetupLogger()
|
||||
public static void SetupLogger(int shardId)
|
||||
{
|
||||
var logConfig = new LoggingConfiguration();
|
||||
var consoleTarget = new ColoredConsoleTarget()
|
||||
{
|
||||
Layout = @"${date:format=HH\:mm\:ss} ${logger:shortName=True} | ${message}"
|
||||
Layout = shardId + @" ${date:format=HH\:mm\:ss} ${logger:shortName=True} | ${message}"
|
||||
};
|
||||
logConfig.AddTarget("Console", consoleTarget);
|
||||
|
||||
|
@ -61,7 +61,7 @@ namespace NadekoBot
|
||||
if (shardId < 0)
|
||||
throw new ArgumentOutOfRangeException(nameof(shardId));
|
||||
|
||||
LogSetup.SetupLogger();
|
||||
LogSetup.SetupLogger(shardId);
|
||||
_log = LogManager.GetCurrentClassLogger();
|
||||
TerribleElevatedPermissionCheck();
|
||||
|
||||
|
@ -63,7 +63,7 @@ namespace NadekoBot.Core.Services
|
||||
public ShardsCoordinator()
|
||||
{
|
||||
//load main stuff
|
||||
LogSetup.SetupLogger();
|
||||
LogSetup.SetupLogger(-1);
|
||||
_log = LogManager.GetCurrentClassLogger();
|
||||
_creds = new BotCredentials();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user