diff --git a/src/package-lock.json b/src/package-lock.json index acdea11..ea29600 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -1,12 +1,12 @@ { "name": "@event-driven-io/pongo-core", - "version": "0.16.0", + "version": "0.16.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@event-driven-io/pongo-core", - "version": "0.16.0", + "version": "0.16.1", "workspaces": [ "packages/dumbo", "packages/pongo" @@ -8674,7 +8674,7 @@ }, "packages/pongo": { "name": "@event-driven-io/pongo", - "version": "0.16.0", + "version": "0.16.1", "bin": { "pongo": "dist/cli.js" }, diff --git a/src/package.json b/src/package.json index 22a16c4..7f4e36e 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "@event-driven-io/pongo-core", - "version": "0.16.0", + "version": "0.16.1", "description": "Pongo - Mongo with strong consistency on top of Postgres", "type": "module", "engines": { diff --git a/src/packages/pongo/package.json b/src/packages/pongo/package.json index f15bdeb..b33e05f 100644 --- a/src/packages/pongo/package.json +++ b/src/packages/pongo/package.json @@ -1,6 +1,6 @@ { "name": "@event-driven-io/pongo", - "version": "0.16.0", + "version": "0.16.1", "description": "Pongo - Mongo with strong consistency on top of Postgres", "type": "module", "scripts": { diff --git a/src/packages/pongo/src/commandLine/shell.ts b/src/packages/pongo/src/commandLine/shell.ts index 52512be..1a0e88d 100644 --- a/src/packages/pongo/src/commandLine/shell.ts +++ b/src/packages/pongo/src/commandLine/shell.ts @@ -108,6 +108,7 @@ const prettifyLogs = (logLevel?: string) => { const startRepl = async (options: { logging: { + printOptions: boolean; logLevel: LogLevel; logStyle: LogStyle; }; @@ -118,13 +119,17 @@ const startRepl = async (options: { }; connectionString: string | undefined; }) => { - console.log(JSON.stringify(options)); // TODO: This will change when we have proper tracing and logging config // For now, that's enough setLogLevel(process.env.DUMBO_LOG_LEVEL ?? options.logging.logLevel); setLogStyle(process.env.DUMBO_LOG_STYLE ?? options.logging.logStyle); - console.log(chalk.green('Starting Pongo Shell (version: 0.16.0)')); + console.log(chalk.green('Starting Pongo Shell (version: 0.16.1)')); + + if (options.logging.printOptions) { + console.log(chalk.green('With Options:')); + console.log(prettyJson(options)); + } const connectionString = options.connectionString ?? @@ -247,6 +252,7 @@ interface ShellOptions { logStyle?: string; logLevel?: string; prettyLog?: boolean; + printOptions?: boolean; } const shellCommand = new Command('shell') @@ -269,6 +275,7 @@ const shellCommand = new Command('shell') '-no-migrations, --disable-auto-migrations', 'Disable automatic migrations', ) + .option('-o, --print-options', 'Print shell options') .option( '-ll, --log-level ', 'Log level: DISABLED, INFO, LOG, WARN, ERROR', @@ -277,12 +284,12 @@ const shellCommand = new Command('shell') .option('-ls, --log-style', 'Log style: RAW, PRETTY', 'RAW') .option('-p, --pretty-log', 'Turn on logging with prettified output') .action(async (options: ShellOptions) => { - console.log(JSON.stringify(options)); const { collection, database } = options; const connectionString = options.connectionString; await startRepl({ logging: { + printOptions: options.printOptions === true, logStyle: options.prettyLog ? LogStyle.PRETTY : ((options.logStyle as LogStyle | undefined) ?? LogStyle.RAW),