Esempio n. 1
0
        /// <summary>
        /// Send an error message to the defined error handling routines.
        /// </summary>
        public static bool error_log(string message, ErrorLogType message_type = ErrorLogType.Default, string destination = null, string extra_headers = null)
        {
            // send to attached trace listener (attached debugger for instance):
            Trace.WriteLine(message, "PHP");

            // pass the message:
            switch (message_type)
            {
            case ErrorLogType.Default:
                LogEventSource.Log.ErrorLog(message);
                return(true);

            default:
                return(false);
            }
        }
Esempio n. 2
0
        public TraceLogger()
        {
            ConsoleTraceListener consoleTraceListener = new ConsoleTraceListener();

            Trace.Listeners.Add(consoleTraceListener);

            errorLog = new ErrorLogType(new ErrorTraceWriter());
            debugLog = new DebugLogType(new DebugTraceWriter());
            infoLog  = new InfoLogType(new InfoTraceWriter());

            logTypeTable = new Dictionary <LogType, AbstractLogType>
            {
                { LogType.Error, errorLog },
                { LogType.Debug, debugLog },
                { LogType.Info, infoLog }
            };
        }
 public RequiredFieldAttribute(ErrorLogType errorLogType)
 {
     this.errorLogType = errorLogType;
 }