@@ -17,12 +17,13 @@ final class LogRotation {
1717 }
1818
1919 static let minimumFileSizeLimitInBytes = 1024 /* 1KB */
20+ static let fileCountLimit : Int = 5
2021
2122 /// The name pattern of files managed by `LogRotation`.
2223 private static let filePattern = #"amplify[.]([0-9])[.]log"#
2324
2425 let directory : URL
25- let fileCountLimit : Int = 5
26+
2627 let fileSizeLimitInBytes : UInt64
2728
2829 private( set) var currentLogFile : LogFile {
@@ -40,7 +41,7 @@ final class LogRotation {
4041 self . directory = directory. absoluteURL
4142 self . fileSizeLimitInBytes = UInt64 ( fileSizeLimitInBytes)
4243 self . currentLogFile = try Self . selectNextLogFile ( from: self . directory,
43- fileCountLimit: fileCountLimit,
44+ fileCountLimit: Self . fileCountLimit,
4445 fileSizeLimitInBytes: self . fileSizeLimitInBytes)
4546 }
4647
@@ -55,7 +56,7 @@ final class LogRotation {
5556 /// 3. If no files matching #1 are present, the file with the oldest last modified date is cleared and selected.
5657 func rotate( ) throws {
5758 self . currentLogFile = try Self . selectNextLogFile ( from: self . directory,
58- fileCountLimit: self . fileCountLimit,
59+ fileCountLimit: Self . fileCountLimit,
5960 fileSizeLimitInBytes: self . fileSizeLimitInBytes)
6061 }
6162
0 commit comments