System.Data.SQLite

Check-in [5ee0181745]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Further tracing enhancements.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5ee0181745b311474c55b1c270fd9f0973597fb3
User & Date: mistachkin 2024-06-26 16:43:44.163
Context
2024-06-26
17:06
Add another trace category value. check-in: e7c3adce8f user: mistachkin tags: trunk
16:43
Further tracing enhancements. check-in: 5ee0181745 user: mistachkin tags: trunk
16:34
Minor robustness enhancement to trace category parsing. check-in: 3545cc987c user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to System.Data.SQLite/SQLiteBase.cs.
1783
1784
1785
1786
1787
1788
1789


1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
  /// These are the trace categories used by various components within this
  /// library.
  /// </summary>
  [Flags()]
  internal enum TraceCategory
  {
      None = 0x0,


      Log = 0x1000,
      Connection = 0x2000,
      Detection = 0x4000,
      Handle = 0x8000,
      Preload = 0x10000,
      Shared = 0x20000,
      Statement = 0x40000,
      Warning = 0x80000,
      Verify = 0x100000,

      Default = Log | Preload | Shared | Warning | Verify
  }

  /// <summary>
  /// These are the supported configuration verbs for use with the native
  /// SQLite library.  They are used with the
  /// <see cref="SQLiteConnection.SetConfigurationOption" /> method.
  /// </summary>







>
>
|
|
|
|
|
|
|
|
|

|







1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
  /// These are the trace categories used by various components within this
  /// library.
  /// </summary>
  [Flags()]
  internal enum TraceCategory
  {
      None = 0x0,

      Self = 0x1000,
      Log = 0x2000,
      Connection = 0x4000,
      Detection = 0x8000,
      Handle = 0x10000,
      Preload = 0x20000,
      Shared = 0x40000,
      Statement = 0x80000,
      Warning = 0x100000,
      Verify = 0x200000,

      Default = Self | Log | Preload | Shared | Warning | Verify
  }

  /// <summary>
  /// These are the supported configuration verbs for use with the native
  /// SQLite library.  They are used with the
  /// <see cref="SQLiteConnection.SetConfigurationOption" /> method.
  /// </summary>
Changes to System.Data.SQLite/UnsafeNativeMethods.cs.
341
342
343
344
345
346
347




348
349
350
351
352
353
354
      /////////////////////////////////////////////////////////////////////////

      private const string DisplayNullArray = "<nullArray>";
      private const string DisplayEmptyArray = "<emptyArray>";

      /////////////////////////////////////////////////////////////////////////





      private const char ArrayOpen = '[';
      private const string ElementSeparator = ", ";
      private const char ArrayClose = ']';

      /////////////////////////////////////////////////////////////////////////

      private static readonly char[] SpaceChars = {







>
>
>
>







341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
      /////////////////////////////////////////////////////////////////////////

      private const string DisplayNullArray = "<nullArray>";
      private const string DisplayEmptyArray = "<emptyArray>";

      /////////////////////////////////////////////////////////////////////////

      private const string TraceDateTimeFormat = "yyyy-MM-dd HH:mm:ss.fffffff";

      /////////////////////////////////////////////////////////////////////////

      private const char ArrayOpen = '[';
      private const string ElementSeparator = ", ";
      private const char ArrayClose = ']';

      /////////////////////////////////////////////////////////////////////////

      private static readonly char[] SpaceChars = {
1027
1028
1029
1030
1031
1032
1033




1034
1035
1036
1037
1038
1039
1040
      /// in this mask will be disabled.
      /// </param>
      internal static void SetTraceCategories(
          TraceCategory categories
          )
      {
          traceCategories = categories; /* NO-LOCK */




      }

      /////////////////////////////////////////////////////////////////////////

      /// <summary>
      /// Attempts to emit a message to the tracing subsystem via the
      /// <see cref="System.Diagnostics.Trace.WriteLine(String)" /> method.







>
>
>
>







1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
      /// in this mask will be disabled.
      /// </param>
      internal static void SetTraceCategories(
          TraceCategory categories
          )
      {
          traceCategories = categories; /* NO-LOCK */

          HelperMethods.Trace(String.Format(
              "Trace categories overridden to: {0}", categories),
              TraceCategory.Self);
      }

      /////////////////////////////////////////////////////////////////////////

      /// <summary>
      /// Attempts to emit a message to the tracing subsystem via the
      /// <see cref="System.Diagnostics.Trace.WriteLine(String)" /> method.
1048
1049
1050
1051
1052
1053
1054

1055




1056
1057
1058
1059
1060
1061
1062
      [Conditional("TRACE")]
      internal static void Trace(
          string message,
          TraceCategory category
          )
      {
          if (IsTraceCategoryEnabled(category))

              System.Diagnostics.Trace.WriteLine(message);




      }

      /////////////////////////////////////////////////////////////////////////

      /// <summary>
      /// Attempts to convert an object value to a string suitable for display
      /// to humans.







>
|
>
>
>
>







1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
      [Conditional("TRACE")]
      internal static void Trace(
          string message,
          TraceCategory category
          )
      {
          if (IsTraceCategoryEnabled(category))
          {
              System.Diagnostics.Trace.WriteLine(
                  String.Format("[{0}] System.Data.SQLite: {1}",
                  DateTime.Now.ToString(TraceDateTimeFormat),
                  message));
          }
      }

      /////////////////////////////////////////////////////////////////////////

      /// <summary>
      /// Attempts to convert an object value to a string suitable for display
      /// to humans.