コード例 #1
0
        //────────────────────────────────────────

        /// <summary>
        /// 警告メッセージの定型文を作ります。
        ///
        /// 旧名:ToText_Configuration
        /// </summary>
        /// <returns></returns>
        public static string ToText_Conf(
            Conf_String cParent
            )
        {
            Log_TextIndented s = new Log_TextIndentedImpl();

            if (null == cParent)
            {
                s.Append("  親要素が指定されていません。");
            }
            else
            {
                s.Append("  設定位置パンくずリスト(問題個所ヒント):");
                s.Newline();
                s.Newline();
                cParent.ToText_Locationbreadcrumbs(s);
                s.Newline();
                s.Newline();

                cParent.ToText_Content(s);
                s.Newline();
                s.Newline();

                s.Append(Log_RecordReportsImpl.ToText_Separator());

                s.Append("  問題を報告したオブジェクトの型: ");
                s.Append(cParent.GetType());
                s.Append(" (これはラッパークラスということもあるかも知れません)");
                s.Newline();
                s.Newline();
            }


            return(s.ToString());
        }
コード例 #2
0
        //────────────────────────────────────────

        /// <summary>
        /// デバッグ報告開始。
        /// </summary>
        /// <param name="d_EnumReport"></param>
        /// <returns>新しいレポート。</returns>
        public Log_RecordReports BeginCreateReport(EnumReport enumReport)
        {
            this.bNotInfiniteLoop = false;

            Log_RecordReportsImpl r;

            r = new Log_RecordReportsImpl(this);

            r.EnumReport = enumReport;

            // ダミーレポートでない場合、レポートを記録します。
            if (EnumReport.Dammy != enumReport)
            {
                r.ToText_Pathbreadcrumbs(this.Log_Callstack);
                this.Add(r);
            }

            return(r);
        }
コード例 #3
0
 /// <summary>
 /// 警告メッセージの定型文を作ります。
 /// </summary>
 /// <returns></returns>
 public string Message_SSeparator()
 {
     return(Log_RecordReportsImpl.ToText_Separator());
 }
コード例 #4
0
 /// <summary>
 /// 警告メッセージの定型文を作ります。
 /// </summary>
 /// <returns></returns>
 public string Message_SException(
     Exception ex
     )
 {
     return(Log_RecordReportsImpl.ToText_Exception(ex));
 }
コード例 #5
0
 /// <summary>
 /// 警告メッセージの定型文を作ります。
 /// </summary>
 /// <returns></returns>
 public string Message_Conf(
     Conf_String parent_Cnf
     )
 {
     return(Log_RecordReportsImpl.ToText_Conf(parent_Cnf));
 }
コード例 #6
0
        //────────────────────────────────────────

        /// <summary>
        /// 警告が出ていれば、そのテキスト。
        /// </summary>
        /// <returns></returns>
        public string ToText(string sGroupTag)
        {
            Log_Method  log_Method             = new Log_MethodImpl(0);
            Log_Reports log_Reports_ThisMethod = new Log_ReportsImpl(log_Method);

            log_Method.BeginMethod(Info_Syntax.Name_Library, this, "ToText", log_Reports_ThisMethod);

            Log_TextIndented s = new Log_TextIndentedImpl();



            s.Append("ログ出力:");
            s.Newline();

            int nErrorCount = 0;


            List <Log_RecordReports> listCopy = new List <Log_RecordReports>(this.list_Record);

            foreach (Log_RecordReports log_RecordReport in listCopy)//todo:bug:ここで リストが変更されているときに例外を出してしまう。
            {
                // グループ・タグが指定されていれば、
                // グループ・タグが一致するメッセージだけを出力します。

                if (log_RecordReport.EnumReport == EnumReport.Error)
                {
                    if ("" == sGroupTag || sGroupTag == log_RecordReport.Tag_Group)
                    {
                        s.Append("(No.");
                        s.Append(nErrorCount);
                        s.Append(") ");

                        // タイトル
                        s.Append(log_RecordReport.ErrorSymbol);

                        if ("" != log_RecordReport.Tag_Group)
                        {
                            // グループ・タグ
                            s.Append(log_RecordReport.Tag_Group);
                        }

                        s.Newline();
                        s.Newline();

                        if ("" != log_RecordReport.Logstack)
                        {
                            s.Append("エラー発生元データの推測ヒント:");
                            s.Append(log_RecordReport.Logstack);
                            s.Newline();
                            s.Newline();
                        }

                        s.Append(log_RecordReport.GetMessage(this));
                        s.Newline();
                        s.Newline();

                        if ("" != log_RecordReport.Logstack)
                        {
                            s.Append("プログラム実行経路推測ヒント:");
                            s.Append(this.Log_Callstack.ToString());
                            s.Newline();
                            s.Newline();
                        }

                        s.Newline();
                        s.Newline();

                        // エラーが発生したメソッド。
                        s.Append(log_RecordReport.FullnameMethod);

                        s.Newline();
                    }

                    // カウンターは、読み飛ばしたエラーもきちんとカウント。
                    nErrorCount++;
                }
            }

            {
                s.Append(Log_RecordReportsImpl.ToText_Separator());
            }

            {
                if ("" != this.Comment_EventCreationMe)
                {
                    s.Append("ロガーの作成に関するコメント:");
                    s.Append(this.Comment_EventCreationMe);
                    s.Newline();
                }
            }

            {
                if (null != this.log_Method_CreationMe)
                {
                    s.Append("ロガー生成場所:");
                    s.Append(this.Log_Method_CreationMe.Fullname);
                    s.Newline();
                }
                else
                {
                    s.Append("ロガー生成場所:ヌル");
                    s.Newline();
                }
            }

            {
                s.Append("このエラーメッセージを作っているロガー:");
                s.Append(log_Method.Fullname);
                s.Newline();
            }

            if (!Log_ReportsImpl.BDebugmode_Static)
            {
                s.Newline();
                s.Newline();
                s.Append("このデバッグ情報は、DebugModeフラグが立っていない状態でのものです。");
                s.Newline();
                s.Append("DDebuggerImpl.DebugModeフラグを立てると、今より詳細な情報が出力されるかもしれません。");
                s.Newline();
            }


            log_Method.EndMethod(log_Reports_ThisMethod);
            log_Reports_ThisMethod.EndLogging(log_Method);
            return(s.ToString());
        }
コード例 #7
0
 /// <summary>
 /// 警告メッセージの定型文を作ります。
 /// </summary>
 /// <returns></returns>
 public string Message_Configuration(
     Configuration_Node parent_Cnf
     )
 {
     return(Log_RecordReportsImpl.ToText_Configuration(parent_Cnf));
 }
コード例 #8
0
ファイル: Log_ReportsImpl.cs プロジェクト: muzudho/XtA
        //────────────────────────────────────────
        /// <summary>
        /// デバッグ報告開始。
        /// </summary>
        /// <param name="d_EnumReport"></param>
        /// <returns>新しいレポート。</returns>
        public Log_RecordReports BeginCreateReport(EnumReport enumReport)
        {
            this.bNotInfiniteLoop = false;

            Log_RecordReportsImpl r;
            r = new Log_RecordReportsImpl(this);

            r.EnumReport = enumReport;

            // ダミーレポートでない場合、レポートを記録します。
            if (EnumReport.Dammy != enumReport)
            {
                r.ToText_Pathbreadcrumbs(this.Log_Callstack);
                this.Add(r);
            }

            return r;
        }