Ejemplo n.º 1
0
 public void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p)
 {
     if (lvl <= this._maxLvl)
     {
         Logging.logStream(Console.Out, msg, lvl, e, l, p);
     }
 }
Ejemplo n.º 2
0
 public void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p)
 {
     if (lvl <= this._maxLvl)
     {
         Logging.logStream(Console.Out, msg, lvl, e, l, p);
     }
 }
Ejemplo n.º 3
0
        public static void logStream(TextWriter _s, string msg, int lvl, LoggingException e, LogType l, params Object[] p)
        {
            msg = string.Format(msg, p) + ((e != null) ? Environment.NewLine + e.Message + Environment.NewLine + e.StackTrace : "");
            string dispMsg = "";

            int    i  = 0;
            string pf = "";

            foreach (string s in msg.Split('\n'))
            {
                if (msg.Trim().Length == 0)
                {
                    dispMsg += pf;
                    i        = 0;
                }
                else
                {
                    dispMsg += pf + ((i++ == 0) ? "" : "\t") + s.Trim();
                    pf       = Environment.NewLine;
                }
            }

            dispMsg.Split('\n').ToList().ForEach(
                m => _s.WriteLine(
                    DateTime.Now.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK") + ": " +
                    ((l != LogType.Information) ? l.ToString() + " : " : "") +
                    m
                    )
                );
        }
Ejemplo n.º 4
0
 public void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p)
 {
     if (lvl <= this._maxLvl)
     {
         EventLog.WriteEntry(this._source, string.Format(msg, p) + ((e != null) ? Environment.NewLine + e.StackTrace : ""), d[l]);
     }
 }
Ejemplo n.º 5
0
        void ILoggingService.log(string msg, int lvl, LoggingException e, LogType l, params Object[] p)
        {
            Logging.log(msg, lvl, e, l, p);

            ILoggingServiceCallback callback = OperationContext.Current.GetCallbackChannel<ILoggingServiceCallback>();

            if (callback != null)
                callback.Logged();
        }
Ejemplo n.º 6
0
 public static void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p)
 {
     foreach (ILogging il in Logging._l)
     {
         if (!il.ignore())
         {
             il.log(msg, lvl, e, l, p);
         }
     }
 }
Ejemplo n.º 7
0
 public void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p)
 {
     lock (this._s)
     {
         if (lvl <= this._maxLvl)
         {
             this._s.AppendLine(DateTime.Now.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK") + ": " + ((l != LogType.Information) ? l.ToString() + " : " : "") + string.Format(msg, p) + ((e != null) ? Environment.NewLine + e.StackTrace : ""));
         }
     }
 }
Ejemplo n.º 8
0
 public void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p)
 {
     if (lvl <= this._maxLvl)
     {
         using (StreamWriter sw = File.AppendText(this._fileName))// Creates or opens and appends
         {
             Logging.logStream(sw, msg, lvl, e, l, p);
         }
     }
 }
Ejemplo n.º 9
0
        public void log(string msg, int lvl, LoggingException e, LogType l, params object[] p)
        {
            myWeb.ILoggingService pipeProxy = pipeFactory.CreateChannel();
            ((IClientChannel)pipeProxy).Open();

            try
            {
                pipeProxy.log(msg, lvl, e, l, p);
            }
            catch
            {
                ((IClientChannel)pipeProxy).Abort();
            }
            finally
            {
                ((IClientChannel)pipeProxy).Close();
            }
        }
Ejemplo n.º 10
0
 public void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p)
 {
     if (lvl <= this._maxLvl)
         EventLog.WriteEntry(this._source, string.Format(msg, p) + ((e != null) ? Environment.NewLine + e.StackTrace : ""), d[l]);
 }
Ejemplo n.º 11
0
 public void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p)
 {
     lock (this._s)
     {
         if (lvl <= this._maxLvl)
             this._s.AppendLine(DateTime.Now.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK") + ": " + ((l != LogType.Information) ? l.ToString() + " : " : "") + string.Format(msg, p) + ((e != null) ? Environment.NewLine + e.StackTrace : ""));
     }
 }
Ejemplo n.º 12
0
        public void log(string msg, int lvl, LoggingException e, LogType l, params object[] p)
        {
            myWeb.ILoggingService pipeProxy = pipeFactory.CreateChannel();
            ((IClientChannel)pipeProxy).Open();

            try
            {
                pipeProxy.log(msg, lvl, e, l, p);
            }
            catch
            {
                ((IClientChannel)pipeProxy).Abort();
            }
            finally
            {
                ((IClientChannel)pipeProxy).Close();
            }
        }
Ejemplo n.º 13
0
        public static void logStream(TextWriter _s, string msg, int lvl, LoggingException e, LogType l, params Object[] p)
        {
            msg = string.Format(msg, p) + ((e != null) ? Environment.NewLine + e.Message + Environment.NewLine + e.StackTrace : "");
            string dispMsg = "";

            int i = 0;
            string pf = "";

            foreach (string s in msg.Split('\n'))
            {
                if (msg.Trim().Length == 0)
                {
                    dispMsg += pf;
                    i = 0;
                }
                else
                {
                    dispMsg += pf + ((i++ == 0) ? "" : "\t") + s.Trim();
                    pf = Environment.NewLine;
                }

            }

            dispMsg.Split('\n').ToList().ForEach(
                m => _s.WriteLine(
                    DateTime.Now.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK") + ": " +
                    ((l != LogType.Information) ? l.ToString() + " : " : "") +
                    m
                    )
            );
        }
Ejemplo n.º 14
0
 public static void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p)
 {
     foreach (ILogging il in Logging._l)
     {
         if (!il.ignore())
             il.log(msg, lvl, e, l, p);
     }
 }
Ejemplo n.º 15
0
 public void log(string msg, int lvl, LoggingException e, LogType l, params Object[] p)
 {
     if (lvl <= this._maxLvl)
     {
         using (StreamWriter sw = File.AppendText(this._fileName))// Creates or opens and appends
         {
             Logging.logStream(sw, msg, lvl, e, l, p);
         }
     }
 }