Skip to content

Commit e78e6e3

Browse files
committed
Minor tweaks
1 parent 45251d8 commit e78e6e3

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Sources/Logger/util/LogConfig.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,14 @@ extension LogConfig {
3131
* ss: The second of the minute with two digits (00-59).
3232
*/
3333
public static let defaultDateFormat: String = "yyyy-MM-dd' 'HH:mm:ss"
34-
// fixme add doc
34+
/**
35+
* A cached instance of `DateFormatter` to enhance performance.
36+
*
37+
* Creating a new `DateFormatter` instance for every date formatting operation can be resource-intensive.
38+
* This cached formatter ensures that a single instance is reused, minimizing overhead and improving efficiency.
39+
* The formatter is configured with the specified `dateFormat`, set to the UTC timezone, and uses the `en_US_POSIX` locale
40+
* to guarantee consistent date formatting regardless of the user's locale settings.
41+
*/
3542
// Creating a new DateFormatter every time a date is formatted can be expensive. Caching the DateFormatter instance using a lazy property improves performance.
3643
private static var cachedDateFormatter: DateFormatter?
3744
/**

0 commit comments

Comments
 (0)