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

misc(asset-saver): tweak output format of logAssets #5696

Merged
merged 1 commit into from
Jul 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lighthouse-core/lib/asset-saver.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,16 @@ async function saveAssets(artifacts, audits, pathWithBasename) {
async function logAssets(artifacts, audits) {
const allAssets = await prepareAssets(artifacts, audits);
allAssets.map(passAssets => {
log.log(`devtoolslog-${passAssets.passName}.json`, JSON.stringify(passAssets.devtoolsLog));
const dtlogdata=JSON.stringify(passAssets.devtoolsLog);
Copy link
Collaborator

Choose a reason for hiding this comment

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

spaces?

Copy link
Member Author

Choose a reason for hiding this comment

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

nah it's more straightforward without any extra whitespace

Copy link
Member

Choose a reason for hiding this comment

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

nah it's more straightforward without any extra whitespace

uh...wha?

Copy link
Member Author

Choose a reason for hiding this comment

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

OHHH i thought the suggestion was to add a spaceindent arg to stringify. :) 🤡

// eslint-disable-next-line no-console
console.log(`loggedAsset %%% devtoolslog-${passAssets.passName}.json %%% ${dtlogdata}`);
const traceIter = traceJsonGenerator(passAssets.traceData);
let traceJson = '';
for (const trace of traceIter) {
traceJson += trace;
}
log.log(`trace-${passAssets.passName}.json`, traceJson);
// eslint-disable-next-line no-console
console.log(`loggedAsset %%% trace-${passAssets.passName}.json %%% ${traceJson}`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there still the max console.log length problem or was that fixed?

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed. :) yay

});
}

Expand Down