Fix DI bugs; implement general logging service

This commit is contained in:
garrettmills
2020-06-17 09:48:01 -05:00
parent 6c4696227b
commit eddb4f1fbe
13 changed files with 258 additions and 5 deletions

View File

@@ -0,0 +1,30 @@
import LifecycleUnit from '../lifecycle/Unit.ts'
import { Unit } from '../lifecycle/decorators.ts'
import { dotenv } from '../external/std.ts'
import { Logging } from '../service/logging/Logging.ts'
import StandardLogger from '../service/logging/StandardLogger.ts'
@Unit()
export default class Scaffolding extends LifecycleUnit {
private config = {}
constructor(
protected logger: Logging
) {
super()
}
public refresh_env() {
this.config = dotenv()
}
public setup_logging() {
StandardLogger.register()
this.logger.info('Logging initialized.', true)
}
public async up() {
this.setup_logging()
this.refresh_env()
}
}