Last active
June 21, 2022 15:36
-
-
Save umutcoskun/ca7622813901fc4b0b7b355d5a5dee71 to your computer and use it in GitHub Desktop.
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
static void LogPrint(Object object) async { | |
int defaultPrintLength = 1020; | |
if (object.toString().length <= defaultPrintLength) { | |
print(object); | |
} else { | |
String log = object.toString(); | |
int start = 0; | |
int endIndex = defaultPrintLength; | |
int logLength = log.length; | |
int tmpLogLength = log.length; | |
while (endIndex < logLength) { | |
print(log.substring(start, endIndex)); | |
endIndex += defaultPrintLength; | |
start += defaultPrintLength; | |
tmpLogLength -= defaultPrintLength; | |
} | |
if (tmpLogLength > 0) { | |
print(log.substring(start, logLength)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment