Skip to content

Commit

Permalink
Improved console logs display
Browse files Browse the repository at this point in the history
  • Loading branch information
panthernet committed Jan 20, 2019
1 parent bbb57ed commit bfd9325
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ThunderED/API/DiscordAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ public async Task UpdateAllUserRoles(List<string> exemptRoles, List<string> auth

foreach (var u in discordUsers)
{
await LogHelper.LogInfo($"AuthCheck =-> {u.Nickname} ({u.Username})", LogCat.AuthCheck, true, false);
//await LogHelper.LogInfo($"AuthCheck =-> {u.Nickname} ({u.Username})", LogCat.AuthCheck, true, false);
await UpdateUserRoles(u.Id, exemptRoles, authCheckIgnoreRoles, false);
}
}
Expand Down
2 changes: 1 addition & 1 deletion ThunderED/Helpers/LogCat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public enum LogCat
Continuous,
HRM,
SLF,
ContractNotification,
ContractNotif,
AuthStandings
}
}
5 changes: 3 additions & 2 deletions ThunderED/Helpers/LogHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public static async Task Log(string message, LogSeverity severity = LogSeverity.

if (logConsole)
{
var msg = $"{DateTime.Now,-19} [{severity,8}] [{cat}]: {message}";
var time = DateTime.Now.ToString("HH:mm:ss");
var msg = $"{time} [{severity,8}] [{cat,13}]: {message}";
await SystemLogFeeder.FeedMessage(msg, severity == LogSeverity.Critical || severity == LogSeverity.Error);

if (!SettingsManager.Settings.Config.RunAsServiceCompatibility)
Expand Down Expand Up @@ -110,7 +111,7 @@ public static async Task LogEx(string message, Exception exception, LogCat cat =
// if(!SettingsManager.Settings.Config.DisableLogIntoFiles)
await File.AppendAllTextAsync(file, $"{DateTime.Now,-19} [{LogSeverity.Critical,8}]: {message} {Environment.NewLine}{exception}{exception.InnerException}{Environment.NewLine}").ConfigureAwait(false);

var msg = $"{DateTime.Now,-19} [{LogSeverity.Critical,8}] [{cat}]: {message}";
var msg = $"{DateTime.Now,-19} [{LogSeverity.Critical,8}] [{cat,13}]: {message}";
var logConsole = !SettingsManager.Settings.Config.RunAsServiceCompatibility;

if (logConsole)
Expand Down
2 changes: 1 addition & 1 deletion ThunderED/Modules/ContractNotificationsModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace ThunderED.Modules
{
public class ContractNotificationsModule : AppModuleBase
{
public override LogCat Category => LogCat.ContractNotification;
public override LogCat Category => LogCat.ContractNotif;
private readonly int _checkInterval;
private DateTime _lastCheckTime = DateTime.MinValue;

Expand Down
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

+ Added admin command **rngroup** to be able to rename auth groups in DB after its name has been changed in config file
+ Fixed possible DiscordAPI deadlock
+ Improved console logs display
+ Refactored database to use identical table name casing
+ Updated DiscordAPI library to version 2.0.1

Expand Down

0 comments on commit bfd9325

Please sign in to comment.