|
- using Serilog;
-
- namespace HKLog
- {
- public class HKLogImport
- {
- public static void Init(string input)
- {
- //日志
- Log.Logger = new LoggerConfiguration()
- .MinimumLevel.Information()
- .WriteTo.File($"Logs/{input}.log", rollingInterval: RollingInterval.Day)
- .CreateLogger();
- }
- public static void WriteInfo(string msg)
- {
- Log.Logger.Information(msg);
- }
- public static void WriteError(Exception ex)
- {
- Log.Logger.Error(ex, ex.Message);
- }
- }
- }
|