add AuthService as a DM authentication handler. (NEEDS SECURITY PASS)

This commit is contained in:
41666 2019-03-10 15:22:05 -05:00
parent 02a66ee7b0
commit f30ca78e40
6 changed files with 154 additions and 4 deletions

View file

@ -4,10 +4,12 @@ import chalk from 'chalk'
export class Logger {
debugOn: boolean
name: string
quietSql: boolean
constructor (name: string, debugOverride: boolean = false) {
this.name = name
this.debugOn = (process.env.DEBUG === 'true' || process.env.DEBUG === '*') || debugOverride
this.quietSql = (process.env.DEBUG_SQL !== 'true')
}
fatal (text: string, ...data: any) {
@ -52,7 +54,7 @@ export class Logger {
}
sql (logger: Logger, ...data: any) {
if (logger.debugOn) {
if (logger.debugOn && !logger.quietSql) {
console.log(chalk.bold('DEBUG SQL:\n '), data)
}
}