Skip to content
This repository was archived by the owner on May 27, 2026. It is now read-only.

Commit b613f39

Browse files
committed
[Milky] Add successful login log
1 parent 06a8dbc commit b613f39

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Lagrange.Milky/Core/CoreLoginService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Lagrange.Core;
2+
using Lagrange.Core.Common;
23
using Lagrange.Core.Common.Interface;
34
using Lagrange.Core.Events.EventArgs;
45
using Lagrange.Milky.Configuration;
@@ -41,6 +42,7 @@ public async Task StartAsync(CancellationToken token)
4142
_logger.LogLoginFailed();
4243
_ = _host.StopAsync(CancellationToken.None);
4344
}
45+
_logger.LogLoginSuccessful(_bot.BotUin, _bot.Config.Protocol, _bot.AppInfo.CurrentVersion);
4446
}
4547

4648
private void HandleNewDeviceVerify(BotContext _, BotNewDeviceVerifyEvent @event)
@@ -131,6 +133,9 @@ public static partial class CoreLoginServiceLoggerExtension
131133
[LoggerMessage(EventId = 3, Level = MSLogLevel.Information, Message = "NewDevice verify required, please scan the QrCode with the device that has already logged in with uin {uin}")]
132134
public static partial void LogNewDeviceVerify(this ILogger<CoreLoginService> logger, long uin);
133135

136+
[LoggerMessage(EventId = 4, Level = MSLogLevel.Information, Message = "{uin} successfully logged in via {protocol} {version}")]
137+
public static partial void LogLoginSuccessful(this ILogger<CoreLoginService> logger, long uin, Protocols protocol, string version);
138+
134139
[LoggerMessage(EventId = 998, Level = MSLogLevel.Critical, Message = "Login failed")]
135140
public static partial void LogLoginFailed(this ILogger<CoreLoginService> logger);
136141

0 commit comments

Comments
 (0)