Skip to content

Commit 6e5b2ec

Browse files
committed
feat(run): add --verbose flag and JSON logging matching i18n
1 parent adb1c34 commit 6e5b2ec

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

packages/cli/src/cli/cmd/run/execute.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@ function createWorkerTask(args: {
204204
.fromPairs()
205205
.value();
206206

207+
// Verbose: print the data to be processed
208+
if (args.ctx.flags.verbose) {
209+
console.log(JSON.stringify(processableData, null, 2));
210+
}
211+
207212
if (!Object.keys(processableData).length) {
208213
await args.ioLimiter(async () => {
209214
// re-push in case some of the unlocalizable / meta data changed
@@ -262,6 +267,11 @@ function createWorkerTask(args: {
262267
},
263268
);
264269

270+
// Verbose: print the processed translation chunk
271+
if (args.ctx.flags.verbose) {
272+
console.log(JSON.stringify(processedTargetData, null, 2));
273+
}
274+
265275
const finalTargetData = _.merge(
266276
{},
267277
sourceData,

packages/cli/src/cli/cmd/run/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ export default new Command()
112112
"--sound",
113113
"Play audio feedback when translations complete (success or failure sounds)",
114114
)
115+
.option(
116+
"--verbose",
117+
"Print the translation data being processed as formatted JSON for each bucket and locale",
118+
)
115119
.action(async (args) => {
116120
let authId: string | null = null;
117121
try {

0 commit comments

Comments
 (0)