mirror of
https://github.com/2dust/v2rayN.git
synced 2026-03-01 21:53:06 +00:00
30 lines
918 B
C#
30 lines
918 B
C#
|
|
namespace ServiceLib.Services.CoreConfig;
|
||
|
|
|
||
|
|
public partial class CoreConfigV2rayService
|
||
|
|
{
|
||
|
|
private async Task<int> GenLog(V2rayConfig v2rayConfig)
|
||
|
|
{
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (_config.CoreBasicItem.LogEnabled)
|
||
|
|
{
|
||
|
|
var dtNow = DateTime.Now;
|
||
|
|
v2rayConfig.log.loglevel = _config.CoreBasicItem.Loglevel;
|
||
|
|
v2rayConfig.log.access = Utils.GetLogPath($"Vaccess_{dtNow:yyyy-MM-dd}.txt");
|
||
|
|
v2rayConfig.log.error = Utils.GetLogPath($"Verror_{dtNow:yyyy-MM-dd}.txt");
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
v2rayConfig.log.loglevel = _config.CoreBasicItem.Loglevel;
|
||
|
|
v2rayConfig.log.access = null;
|
||
|
|
v2rayConfig.log.error = null;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch (Exception ex)
|
||
|
|
{
|
||
|
|
Logging.SaveLog(_tag, ex);
|
||
|
|
}
|
||
|
|
return await Task.FromResult(0);
|
||
|
|
}
|
||
|
|
}
|