Skip to content

Commit e1b5b7c

Browse files
committed
feat(dev-env): add some logging to DevEnvSyncSQLCommand
1 parent 7edddb2 commit e1b5b7c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/commands/dev-env-sync-sql.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { replace } from '@automattic/vip-search-replace';
44
import chalk from 'chalk';
5+
import debugLib from 'debug';
56
import fs from 'fs';
67
import Lando from 'lando';
78
import { pipeline } from 'node:stream/promises';
@@ -17,6 +18,8 @@ import { fixMyDumperTransform, getSqlDumpDetails, SqlDumpType } from '../lib/dat
1718
import { makeTempDir } from '../lib/utils';
1819
import { getReadInterface } from '../lib/validations/line-by-line';
1920

21+
const debug = debugLib( '@automattic/vip:bin:dev-environment' );
22+
2023
/**
2124
* Replaces the domain in the given URL
2225
*
@@ -203,6 +206,12 @@ export class DevEnvSyncSQLCommand {
203206

204207
const primaryUrl = networkSites.find( site => site?.blogId === 1 )?.homeUrl;
205208
const primaryDomain = primaryUrl ? new URL( primaryUrl ).hostname : '';
209+
debug(
210+
'Network sites: %j, primary URL: %s, primary domain: %s',
211+
networkSites,
212+
primaryUrl,
213+
primaryDomain
214+
);
206215

207216
for ( const site of networkSites ) {
208217
if ( ! site?.blogId || site.blogId === 1 ) continue;
@@ -343,6 +352,7 @@ DROP PROCEDURE vip_sync_update_blog_domains;
343352
try {
344353
console.log( 'Extracting site urls from the SQL file...' );
345354
this.siteUrls = await extractSiteUrls( this.sqlFile );
355+
debug( 'Extracted site URLs: %j', this.siteUrls );
346356
} catch ( err ) {
347357
const error = err as Error;
348358
await this.track( 'error', {

0 commit comments

Comments
 (0)