@@ -4,7 +4,7 @@ import { fileExists, isAsyncFunction } from '../utils.js';
44import container from '../container.js' ;
55import { store } from '../store.js' ;
66import recorder from '../recorder.js' ;
7- import * as output from '../output.js' ;
7+ import { debug } from '../output.js' ;
88
99const defaultUser = {
1010 fetch : I => I . grabCookie ( ) ,
@@ -267,7 +267,7 @@ export default function (config) {
267267 } catch ( err ) {
268268 throw new Error ( `Could not load session from ${ fileName } \n${ err } ` ) ;
269269 }
270- output . output . debug ( `Loaded user session for ${ name } ` ) ;
270+ debug ( `Loaded user session for ${ name } ` ) ;
271271 }
272272 }
273273
@@ -288,11 +288,11 @@ export default function (config) {
288288
289289 const cookies = await userSession . fetch ( I ) ;
290290 if ( ! cookies ) {
291- output . output . debug ( 'Cannot save user session with empty cookies from auto login\'s fetch method' ) ;
291+ debug ( 'Cannot save user session with empty cookies from auto login\'s fetch method' ) ;
292292 return ;
293293 }
294294 if ( config . saveToFile ) {
295- output . output . debug ( `Saved user session into file for ${ name } ` ) ;
295+ debug ( `Saved user session into file for ${ name } ` ) ;
296296 fs . writeFileSync ( path . join ( global . output_dir , `${ name } _session.json` ) , JSON . stringify ( cookies ) ) ;
297297 }
298298 store [ `${ name } _session` ] = cookies ;
@@ -309,12 +309,12 @@ export default function (config) {
309309 userSession . check ( I , cookies ) ;
310310 }
311311 recorder . session . catch ( ( err ) => {
312- output . output . debug ( `Failed auto login for ${ name } due to ${ err } ` ) ;
313- output . output . debug ( 'Logging in again' ) ;
312+ debug ( `Failed auto login for ${ name } due to ${ err } ` ) ;
313+ debug ( 'Logging in again' ) ;
314314 recorder . session . start ( 'auto login' ) ;
315315 return loginAndSave ( ) . then ( ( ) => {
316316 recorder . add ( ( ) => recorder . session . restore ( 'auto login' ) ) ;
317- recorder . catch ( ( ) => output . output . debug ( 'continue' ) ) ;
317+ recorder . catch ( ( ) => debug ( 'continue' ) ) ;
318318 } ) . catch ( ( err ) => {
319319 recorder . session . restore ( 'auto login' ) ;
320320 recorder . session . restore ( 'check login' ) ;
0 commit comments