Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

archetype-react-app: [patch] remove log files #381

Merged
merged 1 commit into from
Jun 18, 2017
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
14 changes: 13 additions & 1 deletion packages/electrode-archetype-react-app/arch-gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ function createElectrodeTmpDir() {
createGitIgnoreDir(Path.resolve(eTmpDir), "Electrode tmp dir");
}

function removeLogFiles() {
try {
Fs.unlinkSync(Path.resolve("archetype-exceptions.log"));
} catch (e) {} // eslint-disable-line

try {
Fs.unlinkSync(Path.resolve("archetype-debug.log"));
} catch (e) {} // eslint-disable-line
}

function mkCmd(a) {
return Array.isArray(a) ? a.join(" ") : Array.prototype.slice.call(arguments).join(" ");
}
Expand Down Expand Up @@ -262,7 +272,9 @@ function makeTasks() {
".webpack-dev": () => setWebpackDev(),
".static-files-env": () => setStaticFilesEnv(),
".optimize-stats": () => setOptimizeStats(),
".remove-log-files": () => removeLogFiles(),
build: {
dep: [".remove-log-files"],
desc: AppMode.isSrc
? `Build your app's ${AppMode.src.dir} directory into ${AppMode.lib.dir} for production`
: "Build your app's client bundle",
Expand Down Expand Up @@ -431,7 +443,7 @@ Individual .babelrc files were generated for you in src/client and src/server
debug: ["build-dev-static", "server-debug"],
dev: {
desc: "Start your app with watch in development mode with webpack-dev-server",
dep: [".development-env", ".clean.build", ".mk-dist-dir"],
dep: [".remove-log-files", ".development-env", ".clean.build", ".mk-dist-dir"],
task: [".webpack-dev", ["wds.dev", "server-watch", "generate-service-worker"]]
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const makeWinstonLogger = winston => {
}),
new winston.transports.File({
json: false,
maxsize: 5 * 1024 * 1024, // 5 MB
maxFiles: 1,
filename: "archetype-exceptions.log"
})
],
Expand All @@ -20,6 +22,8 @@ const makeWinstonLogger = winston => {
}),
new winston.transports.File({
json: false,
maxsize: 10 * 1024 * 1024, // 10 MB
maxFiles: 1,
name: "archetype-debug-file",
filename: "archetype-debug.log",
level: "debug"
Expand Down