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 Unified Diffs Ignore Whitespace Patch

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

135
136
137
138
139
140
141





142
143
144
145
146
147
148
        <tr valign="top">
          <td>DefaultFlags_SQLiteConnection</td>
          <td>If this environment variable is set [to anything], it will be
          used by the System.Data.SQLite.SQLiteConnection class as the default
          flags for all opened connections (i.e. when they are not present in
          the connection string).</td>
        </tr>





        <tr valign="top">
          <td>Force_SQLiteLog</td>
          <td>If this environment variable is set [to anything], the SQLite
          logging subsystem may be initialized in a non-default application
          domain.  By default, this is not allowed due to the potential for
          application domain unloading issues.</td>
        </tr>







>
>
>
>
>







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

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

65
66
67
68
69
70
71








72
73
74
75
76
77
78
                used by the System.Data.SQLite.SQLiteConnection class as the
                default flags for all opened connections (i.e. when they are
                not present in the connection string).
    -->
    <!--
    <add key="DefaultFlags_SQLiteConnection" value="" />
    -->









    <!--
        NOTE: If this configuration variable is set [to anything], the SQLite
              logging subsystem may be initialized in a non-default application
              domain.  By default, this is not allowed due to the potential
              for application domain unloading issues.
    -->







>
>
>
>
>
>
>
>







65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
                used by the System.Data.SQLite.SQLiteConnection class as the
                default flags for all opened connections (i.e. when they are
                not present in the connection string).
    -->
    <!--
    <add key="DefaultFlags_SQLiteConnection" value="" />
    -->

    <!--
        NOTE: If this configuration variable is set [to anything], the SQLite
              logging subsystem will be initially disabled when initialized.
    -->
    <!--
    <add key="Disable_SQLiteLog" value="1" />
    -->

    <!--
        NOTE: If this configuration variable is set [to anything], the SQLite
              logging subsystem may be initialized in a non-default application
              domain.  By default, this is not allowed due to the potential
              for application domain unloading issues.
    -->

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

204
205
206
207
208
209
210
211

212



213

214
215
216
217
218
219
220
                    if (rc != SQLiteErrorCode.Ok)
                        throw new SQLiteException(rc,
                            "Failed to initialize logging.");
                }
#endif

                //
                // NOTE: Logging is enabled by default.

                //



                _enabled = true;


                //
                // NOTE: For now, always setup the default log event handler.
                //
                AddDefaultHandler();
            }
        }







|
>

>
>
>
|
>







204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
                    if (rc != SQLiteErrorCode.Ok)
                        throw new SQLiteException(rc,
                            "Failed to initialize logging.");
                }
#endif

                //
                // NOTE: Logging is enabled by default unless the configuration
                //       setting "Disable_SQLiteLog" is present.
                //
                if (UnsafeNativeMethods.GetSettingValue(
                        "Disable_SQLiteLog", null) != null)
                {
                    _enabled = true;
                }

                //
                // NOTE: For now, always setup the default log event handler.
                //
                AddDefaultHandler();
            }
        }