Skip to content

Commit dcadf23

Browse files
authored
internal/logging: Use millisecond time granularity for protocol data file naming (#245)
Reference: #244
1 parent 887b294 commit dcadf23

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changelog/245.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
```release-note:bug
2+
tfprotov5/tf5server: Prevented `TF_LOG_SDK_PROTO_DATA_DIR` file overlap by switching from second to millisecond file naming granularity
3+
```
4+
5+
```release-note:bug
6+
tfprotov6/tf6server: Prevented `TF_LOG_SDK_PROTO_DATA_DIR` file overlap by switching from second to millisecond file naming granularity
7+
```

internal/logging/protocol_data.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func protocolDataDynamicValue6(_ context.Context, value *tfprotov6.DynamicValue)
122122
}
123123

124124
func writeProtocolFile(ctx context.Context, dataDir string, rpc string, message string, field string, fileExtension string, fileContents []byte) {
125-
fileName := fmt.Sprintf("%d_%s_%s_%s", time.Now().Unix(), rpc, message, field)
125+
fileName := fmt.Sprintf("%d_%s_%s_%s", time.Now().UnixMilli(), rpc, message, field)
126126

127127
if fileExtension != "" {
128128
fileName += "." + fileExtension

0 commit comments

Comments
 (0)