From e5284c35dbab0c9b6572c36b3a11d1e0251b3876 Mon Sep 17 00:00:00 2001 From: Subeom Choi Date: Tue, 30 Jan 2024 16:20:13 +0900 Subject: [PATCH] fix: solve issue that logger always paginate log --- Source/AppleLogger/Constant/LoggerConstant.swift | 2 +- Source/AppleLogger/Implement/LogService.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/AppleLogger/Constant/LoggerConstant.swift b/Source/AppleLogger/Constant/LoggerConstant.swift index 037a269..813fb18 100644 --- a/Source/AppleLogger/Constant/LoggerConstant.swift +++ b/Source/AppleLogger/Constant/LoggerConstant.swift @@ -8,7 +8,7 @@ import Foundation struct LoggerConstant { - private static let paginateSize = 900 + static let paginateSize = 900 static let paginatedLog = { (message: String) in stride(from: 0, to: message.count, by: paginateSize).map { point in diff --git a/Source/AppleLogger/Implement/LogService.swift b/Source/AppleLogger/Implement/LogService.swift index 3c05ecd..5bc2504 100644 --- a/Source/AppleLogger/Implement/LogService.swift +++ b/Source/AppleLogger/Implement/LogService.swift @@ -18,7 +18,7 @@ extension LogService { _ message: String, _ printBlock: (String) -> Void ) { - if setting.isPaginateLogEnabled { + if setting.isPaginateLogEnabled, message.count > LoggerConstant.paginateSize { let logs = LoggerConstant.paginatedLog(message) let id = arc4random() % 1000000000