mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
Merge pull request #10585 from appwrite/fix-logs-truncation-tests
fix: logs truncation tests
This commit is contained in:
commit
eff3e4bda2
1 changed files with 15 additions and 2 deletions
|
|
@ -2,8 +2,21 @@ module.exports = async(context) => {
|
|||
// Create a string that is 1000001 characters long (exceeds the 1000000 limit)
|
||||
const longString = 'z' + 'a'.repeat(1000000);
|
||||
|
||||
context.log(longString);
|
||||
context.error(longString);
|
||||
// Split the string into chunks of 8000 characters (max limit for each log and error)
|
||||
const chunkSize = 8000;
|
||||
const chunks = [];
|
||||
|
||||
for (let i = 0; i < longString.length; i += chunkSize) {
|
||||
chunks.push(longString.slice(i, i + chunkSize));
|
||||
}
|
||||
|
||||
chunks.forEach((chunk, index) => {
|
||||
context.log(chunk);
|
||||
});
|
||||
|
||||
chunks.forEach((chunk, index) => {
|
||||
context.error(chunk);
|
||||
});
|
||||
|
||||
return context.res.json({
|
||||
motto: 'Build like a team of hundreds_',
|
||||
|
|
|
|||
Loading…
Reference in a new issue