コード例 #1
0
        public void Initialize(PokerClientLoggerConfiguration configuration)
        {
            if (configuration == null)
            {
                return;
            }

            this.configuration = configuration;

            try
            {
                // Create log directory
                if (!Directory.Exists(configuration.LogDirectory))
                {
                    Directory.CreateDirectory(configuration.LogDirectory);
                }

                // Generate AES key and IV
                using (var aesCryptoProvider = new AesManaged())
                {
                    aesCryptoProvider.GenerateKey();
                    aesCryptoProvider.GenerateIV();

                    aesKey = aesCryptoProvider.Key;
                    aesIV  = aesCryptoProvider.IV;
                }

                isInitialized = true;
            }
            catch
            {
                LogProvider.Log.Error("Logger service has not been initialized.");
            }
        }
コード例 #2
0
        protected override PokerClientLoggerConfiguration CreatePokerClientLoggerConfiguration()
        {
            var logger = new PokerClientLoggerConfiguration
            {
                DateFormat         = "yyy-MM-dd",
                DateTimeFormat     = "HH:mm:ss",
                LogCleanupTemplate = "pbz-games-*-*-*.log",
                LogDirectory       = "Logs",
                LogTemplate        = "pbz-games-{0}.log",
                MessagesInBuffer   = 30
            };

            return(logger);
        }
コード例 #3
0
ファイル: Adda52Importer.cs プロジェクト: Michael-Z/DriveHud
        /// <summary>
        /// Initializes logger with protection
        /// </summary>
        protected virtual void InitializeLogger()
        {
            var logger = new PokerClientLoggerConfiguration
            {
                DateFormat         = "yyy-MM-dd",
                DateTimeFormat     = "HH:mm:ss",
                LogCleanupTemplate = "adda-games-*-*-*.log",
                LogDirectory       = "Logs",
                LogTemplate        = "adda-games-{0}.log",
                MessagesInBuffer   = 10
            };

            protectedLogger = ServiceLocator.Current.GetInstance <IPokerClientEncryptedLogger>(LogServices.Base.ToString());
            protectedLogger.Initialize(logger);
            protectedLogger.CleanLogs();
            protectedLogger.StartLogging();
        }
コード例 #4
0
 public void Initialize(PokerClientLoggerConfiguration configuration)
 {
 }