File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 11const puppeteer = require ( 'puppeteer' ) ;
22const lighthouse = require ( 'lighthouse' ) ;
3+ const log = require ( 'lighthouse-logger' ) ;
34const chromeLauncher = require ( 'chrome-launcher' ) ;
45
56const getBrowserPath = async ( ) => {
@@ -15,12 +16,16 @@ const getBrowserPath = async () => {
1516const runLighthouse = async ( browserPath , url ) => {
1617 let chrome ;
1718 try {
19+ const logLevel = 'info' ;
20+ log . setLevel ( logLevel ) ;
1821 chrome = await chromeLauncher . launch ( {
1922 chromePath : browserPath ,
2023 chromeFlags : [ '--headless' , '--no-sandbox' , '--disable-gpu' ] ,
24+ logLevel,
2125 } ) ;
2226 const results = await lighthouse ( url , {
2327 port : chrome . port ,
28+ logLevel,
2429 } ) ;
2530 if ( results . lhr . runtimeError ) {
2631 throw new Error ( results . lhr . runtimeError . message ) ;
You can’t perform that action at this time.
0 commit comments