Skip to content

Commit

Permalink
Remove error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mRcfps committed Oct 27, 2019
1 parent 4f2827e commit 454499e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 12 deletions.
3 changes: 1 addition & 2 deletions base.ts
Expand Up @@ -3,7 +3,7 @@ import fs from 'fs-extra';
import rc from 'rc';

import defaultConfig from './config';
import { TUTURE_ROOT, TUTURE_IGNORE_PATH, TUTURE_ERROR_LOG } from './constants';
import { TUTURE_ROOT, TUTURE_IGNORE_PATH } from './constants';

export default abstract class BaseCommand extends Command {
// User configurations.
Expand Down Expand Up @@ -35,7 +35,6 @@ export default abstract class BaseCommand extends Command {
fs.readdirSync(TUTURE_ROOT).length === 0
) {
fs.removeSync(TUTURE_ROOT);
fs.removeSync(TUTURE_ERROR_LOG);
}
}
}
2 changes: 0 additions & 2 deletions constants.ts
Expand Up @@ -4,8 +4,6 @@ export const TUTURE_YML_PATH = 'tuture.yml';

export const TUTURE_IGNORE_PATH = '.tutureignore';

export const TUTURE_ERROR_LOG = 'tuture-error.log';

// Directory which houses tuture internal files.
export const TUTURE_ROOT = '.tuture';

Expand Down
4 changes: 2 additions & 2 deletions utils/git.ts
Expand Up @@ -6,7 +6,7 @@ import which from 'which';
import parseDiff from 'parse-diff';

import logger from '../utils/logger';
import { TUTURE_ROOT, TUTURE_ERROR_LOG } from '../constants';
import { TUTURE_ROOT } from '../constants';

/**
* Check if Git command is available.
Expand Down Expand Up @@ -158,7 +158,7 @@ export function removeGitHook() {
* If .gitignore doesn't exist, create one and add the rule.
*/
export function appendGitignore() {
const ignoreRules = `# Tuture-related files\n\n.tuture\n${TUTURE_ERROR_LOG}\n`;
const ignoreRules = '# Tuture-related files\n\n.tuture\n';

if (!fs.existsSync('.gitignore')) {
fs.writeFileSync('.gitignore', ignoreRules);
Expand Down
6 changes: 0 additions & 6 deletions utils/logger.ts
@@ -1,6 +1,5 @@
import chalk from 'chalk';
import winston, { format } from 'winston';
import { TUTURE_ERROR_LOG } from '../constants';

const logLevels = {
error: 0,
Expand Down Expand Up @@ -39,11 +38,6 @@ const logger = winston.createLogger({
levels: logLevels,
transports: [
new winston.transports.Console({ level: 'info', format: consoleFormat }),
new winston.transports.File({
filename: TUTURE_ERROR_LOG,
level: 'error',
format: format.combine(format.timestamp(), fileFormat),
}),
],
});

Expand Down

0 comments on commit 454499e

Please sign in to comment.