Skip to content

Commit

Permalink
Remove tulind. Remove conf file dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
notVitaliy committed Nov 27, 2020
1 parent 668f189 commit bc71a59
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 324 deletions.
3 changes: 3 additions & 0 deletions .env-sample
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ MONGO_REPLICA_SET=
MONGO_AUTH_MECHANISM=

WS_PORT=19807

LOGGER_FILE=''
LOGGER_LEVEL=debug
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"module-alias": "^2.1.0",
"mongodb": "^3.1.1",
"semver": "^5.4.1",
"tulind": "^0.8.10",
"winston": "^3.0.0",
"winston-daily-rotate-file": "^3.3.0",
"ws": "^5.2.2"
Expand Down Expand Up @@ -69,9 +68,6 @@
"tslint": "^5.11.0",
"typescript": "^3.0.1"
},
"engines": {
"node": "^10.0.0"
},
"pre-commit": [
"lint"
],
Expand All @@ -88,4 +84,4 @@
"@m8bTypes": "dist/types/index.js",
"@util": "dist/util/index.js"
}
}
}
161 changes: 0 additions & 161 deletions src/conf.sample.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/strategy/indicators/tulind.ts

This file was deleted.

111 changes: 0 additions & 111 deletions src/types/tulind.d.ts

This file was deleted.

9 changes: 5 additions & 4 deletions src/util/logger.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import winston from 'winston'
import { magic8bot } from '../conf'
import * as Transport from 'winston-transport'
import DailyRotateFile from 'winston-daily-rotate-file'

const { LOGGER_FILE, LOGGER_LEVEL } = process.env

function* getWinstonTransports(): IterableIterator<Transport> {
const fileLogger = isFileLoggerAvailable()
if (fileLogger) {
yield new DailyRotateFile({
filename: magic8bot.loggerFile,
filename: LOGGER_FILE,
datePattern: 'YYYY-MM-DD-HH',
maxSize: '20m',
maxFiles: '7d',
Expand All @@ -34,11 +35,11 @@ const formatter = winston.format.combine(
)

const isFileLoggerAvailable = () => {
return magic8bot.loggerFile && magic8bot.loggerFile.length > 0
return LOGGER_FILE && LOGGER_FILE.length > 0
}

export const logger = winston.createLogger({
level: magic8bot.loggerLevel,
level: LOGGER_LEVEL,
format: formatter,
transports: Array.from(getWinstonTransports()),
})
Loading

0 comments on commit bc71a59

Please sign in to comment.