Exemplo n.º 1
0
        protected virtual void OnMessageGenerated(MessageGeneratedEventArgs e)
        {
            EventHandler <MessageGeneratedEventArgs> handler = MessageGenerated;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemplo n.º 2
0
        public void ShowLogClient(string info)
        {
            Logger logger = LogManager.GetLogger("fileLogger");

            //var config = new NLog.Config.LoggingConfiguration();

            //var logfile = new NLog.Targets.FileTarget("logfile") { FileName = "logs.txt" };
            //var logconsole = new NLog.Targets.ConsoleTarget("logconsole");

            //config.AddRule(LogLevel.Info, LogLevel.Fatal, logconsole);
            //config.AddRule(LogLevel.Debug, LogLevel.Fatal, logfile);

            //NLog.LogManager.Configuration = config;
            logger.Info(info);

            MessageGeneratedEventArgs args = new MessageGeneratedEventArgs();

            args.Message = info;

            OnMessageGenerated(args);
        }