Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#173147132] Send chunked log to instabug #1870

Merged
merged 5 commits into from
Jun 4, 2020

Conversation

fabriziofff
Copy link
Contributor

Short description:
This pr allows to send log to instabug divided into maximum chunks of 4096 characters.

List of changes proposed in this pull request:

  • Added the method instabugLogChunked.

@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Jun 3, 2020

Affected stories

  • 🌟 #173147132: Come DEV voglio che il log inviato a instabug sia chunked

Generated by 🚫 dangerJS

ts/boot/configureInstabug.ts Show resolved Hide resolved
if (chunks) {
chunks.forEach((chunk, i) => {
const count = chunks.length > 1 ? ` ${i + 1}/${chunks.length}` : "";
InstabugLogger[typeLog](`[${tag}${count}] ${chunk}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tag could be undefined

Suggested change
InstabugLogger[typeLog](`[${tag}${count}] ${chunk}`);
const tagPrefix = fromNullable(tag).fold("", t => `${t} `);
const prefix =
chunks.length > 1 ? `[${tagPrefix}${i + 1}/${chunks.length}] ` : "";
return `${prefix}${chunk}`;
InstabugLogger[typeLog](`[${tag}${count}] ${chunk}`);

tagPrefix could be computed just one time and placed outside of the forEach

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in 8909a96

@Undermaken Undermaken merged commit be27ebb into master Jun 4, 2020
@Undermaken Undermaken deleted the 173147132-chunked-instabug-log branch June 4, 2020 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants