Skip to content

Commit

Permalink
introducing TSynLogFamily.ZonedTimestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Bouchez committed Aug 19, 2023
1 parent 8db84c1 commit 53d311f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/core/mormot.core.log.pas
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ TSynLogFamily = class
fIncludeUserNameInFileName: boolean;
fHighResolutionTimestamp: boolean;
fLocalTimestamp: boolean;
fZonedTimestamp: boolean;
fWithUnitName: boolean;
fWithInstancePointer: boolean;
fNoFile: boolean;
Expand Down Expand Up @@ -860,6 +861,10 @@ TSynLogFamily = class
// - you may set this property to TRUE to store local time instead
property LocalTimestamp: boolean
read fLocalTimestamp write fLocalTimestamp;
/// by default, UTC values have no time zone
// - you may set this property to TRUE to append a Z after the timestamp
property ZonedTimestamp: boolean
read fZonedTimestamp write fZonedTimestamp;
/// if TRUE, will log the unit name with an object instance if available
// - unit name is available from RTTI if the class has published properties
// - set to TRUE by default, for better debugging experience
Expand Down Expand Up @@ -5355,7 +5360,11 @@ procedure TSynLog.LogCurrentTime;
fWriter.AddBinToHexDisplay(@fCurrentTimestamp, SizeOf(fCurrentTimestamp));
end
else
begin
fWriter.AddCurrentLogTime(fFamily.LocalTimestamp);
if fFamily.ZonedTimestamp then
fWriter.Add('Z');
end;
end;

procedure TSynLog.LogHeader(Level: TSynLogInfo);
Expand Down
2 changes: 1 addition & 1 deletion src/mormot.commit.inc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
'2.1.5769'
'2.1.5770'

0 comments on commit 53d311f

Please sign in to comment.