Ejemplo n.º 1
0
        public string PathCombineWithAppData(string segment)
        {
            string appDataPath = AppDataHelper.GetAppDataPath();
            string combined    = PathCombine(appDataPath, segment);

            return(combined);
        }
Ejemplo n.º 2
0
        public static ILogger Initialize()
        {
            string appDataPath = AppDataHelper.GetAppDataPath();
            string logFilePath = Path.Combine(appDataPath, "Logs", LOG_FILE);

            LoggerConfiguration loggerConfiguration = new LoggerConfiguration()
                                                      .MinimumLevel.Verbose()
                                                      .WriteTo.File(
                path: logFilePath,
                restrictedToMinimumLevel: LogEventLevel.Warning,
                rollOnFileSizeLimit: true,
                fileSizeLimitBytes: 1048576
                );

            if (Debugger.IsAttached)
            {
                loggerConfiguration.WriteTo.Debug(restrictedToMinimumLevel: LogEventLevel.Verbose);
            }

            return(Log.Logger = loggerConfiguration.CreateLogger());
        }