System.Data.SQLite
Check-in [e7b7d00d63]
Not logged in

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

Overview
Comment:Add support for the 'Disable_SQLiteLog' configuration setting.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e7b7d00d6312431950cc76bc80b8fd61c8c36688
User & Date: mistachkin 2018-05-29 01:55:06
Context
2018-05-29
01:57
Fix typo in the previous check-in. check-in: c29222dd3a user: mistachkin tags: trunk
01:55
Add support for the 'Disable_SQLiteLog' configuration setting. check-in: e7b7d00d63 user: mistachkin tags: trunk
2018-05-28
23:41
Fix compilation issues due to internal changes in the SQLite core library. check-in: fb73a8c990 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Doc/Extra/Provider/environment.html.

   135    135           <tr valign="top">
   136    136             <td>DefaultFlags_SQLiteConnection</td>
   137    137             <td>If this environment variable is set [to anything], it will be
   138    138             used by the System.Data.SQLite.SQLiteConnection class as the default
   139    139             flags for all opened connections (i.e. when they are not present in
   140    140             the connection string).</td>
   141    141           </tr>
          142  +        <tr valign="top">
          143  +          <td>Disable_SQLiteLog</td>
          144  +          <td>If this configuration variable is set [to anything], the SQLite
          145  +          logging subsystem will be initially disabled when initialized.</td>
          146  +        </tr>
   142    147           <tr valign="top">
   143    148             <td>Force_SQLiteLog</td>
   144    149             <td>If this environment variable is set [to anything], the SQLite
   145    150             logging subsystem may be initialized in a non-default application
   146    151             domain.  By default, this is not allowed due to the potential for
   147    152             application domain unloading issues.</td>
   148    153           </tr>

Changes to System.Data.SQLite/Configurations/System.Data.SQLite.dll.config.

    65     65                   used by the System.Data.SQLite.SQLiteConnection class as the
    66     66                   default flags for all opened connections (i.e. when they are
    67     67                   not present in the connection string).
    68     68       -->
    69     69       <!--
    70     70       <add key="DefaultFlags_SQLiteConnection" value="" />
    71     71       -->
           72  +
           73  +    <!--
           74  +        NOTE: If this configuration variable is set [to anything], the SQLite
           75  +              logging subsystem will be initially disabled when initialized.
           76  +    -->
           77  +    <!--
           78  +    <add key="Disable_SQLiteLog" value="1" />
           79  +    -->
    72     80   
    73     81       <!--
    74     82           NOTE: If this configuration variable is set [to anything], the SQLite
    75     83                 logging subsystem may be initialized in a non-default application
    76     84                 domain.  By default, this is not allowed due to the potential
    77     85                 for application domain unloading issues.
    78     86       -->

Changes to System.Data.SQLite/SQLiteLog.cs.

   204    204                       if (rc != SQLiteErrorCode.Ok)
   205    205                           throw new SQLiteException(rc,
   206    206                               "Failed to initialize logging.");
   207    207                   }
   208    208   #endif
   209    209   
   210    210                   //
   211         -                // NOTE: Logging is enabled by default.
          211  +                // NOTE: Logging is enabled by default unless the configuration
          212  +                //       setting "Disable_SQLiteLog" is present.
   212    213                   //
   213         -                _enabled = true;
          214  +                if (UnsafeNativeMethods.GetSettingValue(
          215  +                        "Disable_SQLiteLog", null) != null)
          216  +                {
          217  +                    _enabled = true;
          218  +                }
   214    219   
   215    220                   //
   216    221                   // NOTE: For now, always setup the default log event handler.
   217    222                   //
   218    223                   AddDefaultHandler();
   219    224               }
   220    225           }