-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: add isPaginateLogEnabled to SabyAppleLogger
- Loading branch information
Showing
8 changed files
with
82 additions
and
22 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// LoggerConstant.swift | ||
// SabyAppleLogger | ||
// | ||
// Created by WOF on 1/23/24. | ||
// | ||
|
||
import Foundation | ||
|
||
struct LoggerConstant { | ||
private static let paginateSize = 10 | ||
|
||
static let paginatedLog = { (message: String) in | ||
stride(from: 0, to: message.count, by: paginateSize).map { point in | ||
let start = message.index( | ||
message.startIndex, | ||
offsetBy: point | ||
) | ||
let end = message.index( | ||
message.startIndex, | ||
offsetBy: point + paginateSize, | ||
limitedBy: message.endIndex | ||
) ?? message.endIndex | ||
return String(message[start..<end]) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters