Esempio n. 1
0
 public override string ToString()
 {
     return($"{nameof(LogItemChanged)}{Environment.NewLine}" +
            $"Log time: {LogTime.ToString()}{Environment.NewLine}" +
            $"Source path: {SourcePath}{Environment.NewLine}" +
            $"Backup path: {BackupPath}{Environment.NewLine}");
 }
Esempio n. 2
0
 public override string ToString()
 {
     return($"{nameof(LogItemRenamed)}{Environment.NewLine}" +
            $"Log time: {LogTime.ToString()}{Environment.NewLine}" +
            $"Old path: {OldPath}{Environment.NewLine}" +
            $"New path: {NewPath}{Environment.NewLine}");
 }
Esempio n. 3
0
        public override string ToString()
        {
            var sb = new StringBuilder();

            sb.Append(LogTime.ToString("yyyy-MM-dd HH:mm:ss"));
            sb.Append(' ');
            sb.Append(LogLevel);
            sb.Append(": ");
            int pos = Message.IndexOf('\n');

            if (pos > -1)
            {
                sb.Append(Message.Substring(0, pos - 1));
                sb.Append("...");
            }
            else
            {
                sb.Append(Message);
            }
            if (GroupDisplayName != null)
            {
                sb.Append(" (Group: ");
                sb.Append(GroupDisplayName);
                sb.Append(")");
            }
            return(sb.ToString());
        }
Esempio n. 4
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(LogTime.ToString("yyyy-MM-dd HH:mm:ss"));
            sb.Append(": ");
            if (Operation != GroupMemberOperations.None)
            {
                sb.Append(Operation.ToString());
                sb.Append("ed ");
            }
            else
            {
                sb.Append("Did nothing to ");
            }
            sb.Append(TargetDisplayName ?? TargetId.ToString());
            if (Operation == GroupMemberOperations.Add)
            {
                sb.Append(" to ");
            }
            else if (Operation == GroupMemberOperations.Remove)
            {
                sb.Append(" from ");
            }
            else
            {
                sb.Append(" for ");
            }
            sb.Append(GroupDisplayName ?? GroupId.ToString());
            return(sb.ToString());
        }
Esempio n. 5
0
        public string GetErrorItemText(ErrorItemViewKind errorViewKind)
        {
            StringBuilder sb = new StringBuilder("");

            if ((errorViewKind & ErrorItemViewKind.DBId) != 0)
            {
                sb.Append($"[{Id.ToString()}]");
            }

            if ((errorViewKind & ErrorItemViewKind.LogTime) != 0)
            {
                sb.AppendSeparated(LogTime.ToString());
            }

            if ((errorViewKind & ErrorItemViewKind.EventTime) != 0)
            {
                sb.AppendSeparated(EventTime.ToString());
            }

            if ((errorViewKind & ErrorItemViewKind.ErrorMessage) != 0)
            {
                sb.AppendSeparated(ErrorMessage);
            }

            return(sb.ToString());
        }
Esempio n. 6
0
        public string GetMeasurementItemText(MeasurementItemViewKind viewKind)
        {
            StringBuilder sb = new StringBuilder("");

            if ((viewKind & MeasurementItemViewKind.DBId) != 0)
            {
                sb.Append($"[{Id.ToString()}]");
            }

            if ((viewKind & MeasurementItemViewKind.LogTime) != 0)
            {
                sb.AppendSeparated(LogTime.ToString());
            }

            if ((viewKind & MeasurementItemViewKind.EventTime) != 0)
            {
                sb.AppendSeparated(EventTime.ToString());
            }

            if ((viewKind & MeasurementItemViewKind.Value) != 0)
            {
                sb.AppendSeparated(MeasuredValue.ToString());
            }

            if ((viewKind & MeasurementItemViewKind.Unit) != 0)
            {
                sb.AppendSeparated(MeasuredUnit.ToString());
            }

            return(sb.ToString());
        }
Esempio n. 7
0
        public XElement ToXElement(string Name)
        {
            XElement xml = new XElement(Name,
                                        new XElement("Direction", Direction.ToString()),
                                        new XElement("LogTime", LogTime.ToString("yyyy-MM-dd HH.mm.ss.ffff")),
                                        new XElement("ByteStream", ByteStream.ToHex(' ')));

            return(xml);
        }
Esempio n. 8
0
        public override string ToString()
        {
            string Result = LogTime.ToString() + " [" + Type.ToString() + "] " + Author + ": " + Message;

            foreach (string ItemName in ItemList)
            {
                Result += " [" + ItemName + "]";
            }

            return(Result);
        }
Esempio n. 9
0
 /// <summary>
 /// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
 /// </summary>
 /// <returns>
 /// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
 /// </returns>
 /// <filterpriority>2</filterpriority>
 public override string ToString()
 {
     var result = String.Format(@"【{0}】【{1}】{2} {3}-{4}-{5}-{6}-{7}",
                                State,
                                LogTime.ToString("yyyy/MM/dd hh:mm:ss"),
                                String.IsNullOrEmpty(User) ? "" : String.Format("【{0}】", User),
                                Message,
                                Location,
                                CallStack,
                                ExtData == null ? "" : String.Format("【{0}】", ExtData),
                                exceptionDetails);
     return result;
 }
Esempio n. 10
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(LogTime.ToString("yyyy-MM-dd HH:mm:ss"));
            sb.Append(": ");
            sb.Append("Document: ");
            sb.Append(DocumentId);
            sb.Append(", Actor: ");
            sb.Append(Actor);
            sb.Append(", Action: ");
            sb.Append(Action);
            sb.Append('.');
            return(sb.ToString());
        }
Esempio n. 11
0
        public string GetErrorItemText(ErrorItemViewKind UnitViewKind)
        {
            string str = "";

            if ((UnitViewKind & ErrorItemViewKind.DBId) != 0)
            {
                str += "[" + Id.ToString() + "]";
            }

            if ((UnitViewKind & ErrorItemViewKind.LogTime) != 0)
            {
                if (!string.IsNullOrWhiteSpace(str))
                {
                    str += " ";
                }
                str += LogTime.ToString();
            }

            if ((UnitViewKind & ErrorItemViewKind.EventTime) != 0)
            {
                if (!string.IsNullOrWhiteSpace(str))
                {
                    str += " ";
                }
                str += EventTime.ToString();
            }

            if ((UnitViewKind & ErrorItemViewKind.ErrorMessage) != 0)
            {
                if (!string.IsNullOrWhiteSpace(str))
                {
                    str += " ";
                }
                str += ErrorMessage.ToString();
            }

            return(str);
        }
Esempio n. 12
0
 public override string ToString()
 {
     return(string.Format("idx:{2} t:{0} msg:{1}|", LogTime.ToString("yyyy-MM-dd HH:mm:ss"), Message, LogIndex));
 }
Esempio n. 13
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public override string ToString()
 {
     return(String.Format("{0} {1} - {2} \r\n", LogTime.ToString("HH:mm:ss"), LogLevel, Message));
 }
Esempio n. 14
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public override string ToString()
 {
     return(String.Format("{0} {1} {2} - {3} \r\n", LogTime.ToString("HH:mm:ss"), strUtil.GetTitleCase(LogLevel), Source, Message));
 }
Esempio n. 15
0
 public override string ToString()
 {
     return($"{nameof(LogItemDeleted)}{Environment.NewLine}" +
            $"Log time: {LogTime.ToString()}{Environment.NewLine}" +
            $"Path: {Path}{Environment.NewLine}");
 }
Esempio n. 16
0
 public override string ToString()
 {
     return(LogTime.ToString("yyyy.MM.dd@HH:mm:ss") + " " + LogText);
 }
Esempio n. 17
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("{0} | ", LogTime.ToString("MM/dd/yyyy hh:mm:ss.ffff tt"));
            //sb.AppendLine();

            if (CallerIp != null && CallerPort > 0)
            {
                sb.AppendFormat("Caller Ip: {0} | ", CallerIp);
                sb.AppendFormat("Caller Port: {0} | ", CallerPort);
                //sb.AppendLine();
            }

            sb.AppendFormat("Operation: {0} | ", OperationName ?? String.Empty);
            //sb.AppendLine();
            sb.AppendFormat("Log type: {0} | ", LogType);
            //sb.AppendLine();


            if (InputsData != null)
            {
                string strInputs = InputsData.ToString();
                if (!string.IsNullOrEmpty(strInputs))
                {
                    sb.AppendFormat("Inputs: {0} | ", strInputs);
                    //sb.AppendLine();
                }
            }

            if (OutputsData != null)
            {
                string strOutputs = OutputsData.ToString();
                if (!string.IsNullOrEmpty(strOutputs))
                {
                    sb.AppendFormat("Outputs: {0} | ", strOutputs);
                    //sb.AppendLine();
                }
            }

            if (ReturnValueData != null)
            {
                string strReturnValue = ReturnValueData.ToString();
                if (!string.IsNullOrEmpty(strReturnValue))
                {
                    sb.AppendFormat("Return value: {0} | ", strReturnValue);
                    //sb.AppendLine();
                }
            }

            if (ExceptionData != null)
            {
                string strException = ExceptionData.ToString();
                if (!string.IsNullOrEmpty(strException))
                {
                    sb.AppendFormat("Exception: {0} | ", strException);
                    //sb.AppendLine();
                }
            }

            if (InformationData != null)
            {
                string strInformation = InformationData.ToString();
                if (!string.IsNullOrEmpty(strInformation))
                {
                    sb.AppendFormat("Information: {0} | ", strInformation);
                    //sb.AppendLine();
                }
            }
            sb.AppendLine();
            return(sb.ToString());
        }
Esempio n. 18
0
 public override string ToString()
 {
     return
         ($"{nameof(LogTime)}={LogTime.ToString()}, {nameof(Tag)}={Tag ?? "None"}, Member={CallerMemberName}, File={CallerFilePath}({CallerLineNumber.ToString()})");
 }
Esempio n. 19
0
 public string TimeAsString()
 {
     return(LogTime.ToString(TIME_DISPLAY_FORMAT));
 }
Esempio n. 20
0
 public override string ToString()
 {
     return(string.Format("{0} ==> {1}", LogTime.ToString("yyyy-MM-dd HH:mm:ss"), LogMsg));
 }
Esempio n. 21
0
 public string GetDateString()
 {
     return(LogTime.ToString("yyyyMMdd", CultureInfo.InvariantCulture));
 }