Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions firebase-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## NEXT

- Fixed an issue where log files would be written to non-Firebase directories.

## 0.10.3

- Updated internal firebase-tools dependency to 13.21.0
Expand Down
8 changes: 7 additions & 1 deletion firebase-vscode/src/logger-wrapper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as path from "path";
import * as vscode from "vscode";
import * as fs from "fs";
import * as os from "os";
import { transports, format } from "winston";
import Transport from "winston-transport";
import stripAnsi from "strip-ansi";
Expand Down Expand Up @@ -45,7 +47,11 @@ export function logSetup() {
// Re-implement file logger call from ../../src/bin/firebase.ts to not bring
// in the entire firebase.ts file
const rootFolders = getRootFolders();
const filePath = path.join(rootFolders[0], ".firebase", "logs", "vsce-debug.log");
// Default to a central path, but write files to a local path if we're in a Firebase directory.
let filePath = path.join(os.homedir(), ".cache", "firebase", "logs", "vsce-debug.log");
if (fs.existsSync(path.join(rootFolders[0], "firebase.json"))) {
filePath = path.join(rootFolders[0], ".firebase", "logs", "vsce-debug.log");
}
pluginLogger.info("Logging to path", filePath);
cliLogger.add(
new transports.File({
Expand Down
Loading