diff --git a/out/locale/en/LC_MESSAGES/default.po b/out/locale/en/LC_MESSAGES/default.po index 6b47eb95..a912ed6e 100644 --- a/out/locale/en/LC_MESSAGES/default.po +++ b/out/locale/en/LC_MESSAGES/default.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: HeidiSQL\n" "POT-Creation-Date: 2012-11-05 21:40\n" -"PO-Revision-Date: 2022-10-03 08:54+0200\n" +"PO-Revision-Date: 2022-10-20 18:45+0200\n" "Last-Translator: Ansgar Becker \n" "Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n" "Language: en\n" @@ -2802,6 +2802,9 @@ msgstr "Enable query history" msgid "days to keep queries before removing them" msgstr "days to keep queries before removing them" +msgid "Add timestamp to all log messages" +msgstr "Add timestamp to all log messages" + #. optionsform..pagecontrolMain..tabSQL..lblFont..Caption #: options.dfm:357 msgid "Editor font:" diff --git a/source/apphelpers.pas b/source/apphelpers.pas index d1272ed7..dc423ac0 100644 --- a/source/apphelpers.pas +++ b/source/apphelpers.pas @@ -192,7 +192,7 @@ type asTabsToSpaces, asFilterPanel, asAllowMultipleInstances, asFindDialogSearchHistory, asGUIFontName, asGUIFontSize, asTheme, asIconPack, asWebSearchBaseUrl, asFindDialogReplaceHistory, asMaxQueryResults, asLogErrors, - asLogUserSQL, asLogSQL, asLogInfos, asLogDebug, asLogScript, asFieldColorNumeric, + asLogUserSQL, asLogSQL, asLogInfos, asLogDebug, asLogScript, asLogTimestamp, asFieldColorNumeric, asFieldColorReal, asFieldColorText, asFieldColorBinary, asFieldColorDatetime, asFieldColorSpatial, asFieldColorOther, asFieldEditorBinary, asFieldEditorDatetime, asFieldEditorDatetimePrefill, asFieldEditorEnum, asFieldEditorSet, asFieldNullBackground, asRowBackgroundEven, asRowBackgroundOdd, asGroupTreeObjects, asDisplayObjectSizeColumn, asSQLfile, @@ -3753,6 +3753,7 @@ begin InitSetting(asLogScript, 'LogScript', 0, False); InitSetting(asLogInfos, 'LogInfos', 0, True); InitSetting(asLogDebug, 'LogDebug', 0, False); + InitSetting(asLogTimestamp, 'LogTimestamp', 0, False); InitSetting(asFieldColorNumeric, 'FieldColor_Numeric', $00FF0000); InitSetting(asFieldColorReal, 'FieldColor_Real', $00FF0048); InitSetting(asFieldColorText, 'FieldColor_Text', $00008000); diff --git a/source/main.pas b/source/main.pas index 711490eb..1a2538d6 100644 --- a/source/main.pas +++ b/source/main.pas @@ -5427,7 +5427,10 @@ var begin LogItem := TDBLogItem.Create; LogItem.Category := Category; - LogItem.LineText := Msg; + if AppSettings.ReadBool(asLogTimestamp) then + LogItem.LineText := '['+FormatDateTime('hh:nn:ss.zzz', Now)+'] '+ Msg + else + LogItem.LineText := Msg; LogItem.Connection := Connection; PostponedLogItems.Add(LogItem); diff --git a/source/preferences.dfm b/source/preferences.dfm index a4c840fe..9e240caa 100644 --- a/source/preferences.dfm +++ b/source/preferences.dfm @@ -13,7 +13,6 @@ object frmPreferences: TfrmPreferences Font.Height = -12 Font.Name = 'Tahoma' Font.Style = [] - OldCreateOrder = False Position = poMainFormCenter OnClose = FormClose OnCreate = FormCreate @@ -21,7 +20,6 @@ object frmPreferences: TfrmPreferences DesignSize = ( 722 460) - PixelsPerInch = 96 TextHeight = 14 object pagecontrolMain: TPageControl Left = 8 @@ -551,6 +549,15 @@ object frmPreferences: TfrmPreferences TabOrder = 9 OnClick = Modified end + object chkLogTimestamp: TCheckBox + Left = 220 + Top = 292 + Width = 475 + Height = 17 + Caption = 'Add timestamp to all log messages' + TabOrder = 16 + OnClick = Modified + end end object tabSQL: TTabSheet Caption = 'SQL' diff --git a/source/preferences.pas b/source/preferences.pas index 60d0cc93..33dab28e 100644 --- a/source/preferences.pas +++ b/source/preferences.pas @@ -179,6 +179,7 @@ type editRealTrailingZeros: TEdit; updownRealTrailingZeros: TUpDown; lblRealTrailingZerosHint: TLabel; + chkLogTimestamp: TCheckBox; procedure FormShow(Sender: TObject); procedure Modified(Sender: TObject); procedure Apply(Sender: TObject); @@ -311,6 +312,7 @@ begin AppSettings.WriteBool(asQueryHistoryEnabled, chkQueryHistory.Checked); AppSettings.WriteInt(asQueryHistoryKeepDays, updownQueryHistoryKeepDays.Position); AppSettings.WriteBool(asLogHorizontalScrollbar, chkHorizontalScrollbar.Checked); + AppSettings.WriteBool(asLogTimestamp, chkLogTimestamp.Checked); for i:=0 to SynSQLSynSQLSample.AttrCount - 1 do begin Attri := SynSQLSynSQLSample.Attribute[i]; AppSettings.WriteInt(asHighlighterForeground, Attri.Foreground, Attri.Name); @@ -683,6 +685,7 @@ begin chkQueryHistory.Checked := AppSettings.ReadBool(asQueryHistoryEnabled); updownQueryHistoryKeepDays.Position := AppSettings.ReadInt(asQueryHistoryKeepDays); chkHorizontalScrollbar.Checked := AppSettings.ReadBool(asLogHorizontalScrollbar); + chkLogTimestamp.Checked := AppSettings.ReadBool(asLogTimestamp); // Default column width in grids: updownMaxColWidth.Position := AppSettings.ReadInt(asMaxColWidth);