Send() 공개 메소드

public Send ( string msg ) : void
msg string
리턴 void
예제 #1
0
        void setupNLog(MyErrorReporter myErrorReporter)
        {
            LoggerFactory.globalLogLevel = LogLevel.On;

            // Add appender to print messages with Console.WriteLine
            LoggerFactory.AddAppender((logger, logLevel, message) => Console.WriteLine(message));

            // Add another appender to write messages to a file
            var fileWriter = new FileWriter("Log.txt");
            LoggerFactory.AddAppender((logger, logLevel, message) => fileWriter.WriteLine(message));

            // Or simply create your own custom appender, e.g.
            // a custom error reporter, which only sends messages
            // if the log level is at least 'error'
            LoggerFactory.AddAppender((logger, logLevel, message) => {
                if (logLevel >= LogLevel.Error) {
                    myErrorReporter.Send(logLevel + " " + message);
                }
            });
        }
예제 #2
0
        void setupNLog(MyErrorReporter myErrorReporter)
        {
            LoggerFactory.globalLogLevel = LogLevel.On;

            // Add appender to print messages with Console.WriteLine
            LoggerFactory.AddAppender((logger, logLevel, message) => Console.WriteLine(message));

            // Add another appender to write messages to a file
            var fileWriter = new FileWriter("Log.txt");

            LoggerFactory.AddAppender((logger, logLevel, message) => fileWriter.WriteLine(message));

            // Or simply create your own custom appender, e.g.
            // a custom error reporter, which only sends messages
            // if the log level is at least 'error'
            LoggerFactory.AddAppender((logger, logLevel, message) => {
                if (logLevel >= LogLevel.Error)
                {
                    myErrorReporter.Send(logLevel + " " + message);
                }
            });
        }