Skip to content

Commit aeb2901

Browse files
authored
Ensure functionsEmulator respects logVerbosity (#6521)
1 parent ea58114 commit aeb2901

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
- Fix blocking functions in the emulator when using multiple codebases (#6504).
22
- Add force flag call-out for bypassing prompts (#6506).
3+
- Fixed an issue where the functions emulator did not respect the `--log-verbosity` flag (#2859).

scripts/emulator-tests/functionsEmulator.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ describe("FunctionsEmulator", function () {
118118
projectId: TEST_PROJECT_ID,
119119
projectDir: MODULE_ROOT,
120120
emulatableBackends: [TEST_BACKEND],
121-
quiet: true,
121+
verbosity: "QUIET",
122122
adminSdkConfig: {
123123
projectId: TEST_PROJECT_ID,
124124
databaseURL: `https://${TEST_PROJECT_ID}-default-rtdb.firebaseio.com`,

src/emulator/controller.ts

+1
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@ export async function startAll(
565565
host: functionsAddr.host,
566566
port: functionsAddr.port,
567567
debugPort: inspectFunctions,
568+
verbosity: options.logVerbosity,
568569
projectAlias: options.projectAlias,
569570
});
570571
await startEmulator(functionsEmulator);

src/emulator/functionsEmulator.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export interface FunctionsEmulatorArgs {
115115
account?: Account;
116116
port?: number;
117117
host?: string;
118-
quiet?: boolean;
118+
verbosity?: "SILENT" | "QUIET" | "INFO" | "DEBUG";
119119
disabledRuntimeFeatures?: FunctionsRuntimeFeatures;
120120
debugPort?: number;
121121
remoteEmulators?: Record<string, EmulatorInfo>;
@@ -215,7 +215,9 @@ export class FunctionsEmulator implements EmulatorInstance {
215215

216216
constructor(private args: FunctionsEmulatorArgs) {
217217
// TODO: Would prefer not to have static state but here we are!
218-
EmulatorLogger.setVerbosity(this.args.quiet ? Verbosity.QUIET : Verbosity.DEBUG);
218+
EmulatorLogger.setVerbosity(
219+
this.args.verbosity ? Verbosity[this.args.verbosity] : Verbosity["DEBUG"]
220+
);
219221
// When debugging is enabled, the "timeout" feature needs to be disabled so that
220222
// functions don't timeout while a breakpoint is active.
221223
if (this.args.debugPort) {

src/functionsShellCommandAction.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const actionFunction = async (options: Options) => {
7979

8080
return serveFunctions
8181
.start(options, {
82-
quiet: true,
82+
verbosity: "QUIET",
8383
remoteEmulators,
8484
debugPort,
8585
})

0 commit comments

Comments
 (0)