-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
2,006 additions
and
1,416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/build | ||
/node_modules | ||
.eslintrc.js | ||
webpack.* | ||
/scripts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { LOGGER_LEVEL, LOGGER_LEVEL_DEBUG, LOGGER_LEVEL_ERROR, LOGGER_LEVEL_INFO, LOGGER_LEVEL_WARN } from '@App/model/do/logger'; | ||
import { Logger } from './logger'; | ||
|
||
export class ConsoleLogger implements Logger { | ||
public Logger(level: LOGGER_LEVEL, origin: string, msg: string, title = ''): Logger { | ||
console.log({ level: level, origin: origin, msg: msg, title: title }); | ||
return this; | ||
} | ||
|
||
public Debug(origin: string, msg: string, title = ''): Logger { | ||
return this.Logger(LOGGER_LEVEL_DEBUG, origin, msg, title); | ||
} | ||
|
||
public Info(origin: string, msg: string, title = ''): Logger { | ||
return this.Logger(LOGGER_LEVEL_INFO, origin, msg, title); | ||
} | ||
|
||
public Warn(origin: string, msg: string, title = ''): Logger { | ||
return this.Logger(LOGGER_LEVEL_WARN, origin, msg, title); | ||
} | ||
|
||
public Error(origin: string, msg: string, title = ''): Logger { | ||
return this.Logger(LOGGER_LEVEL_ERROR, origin, msg, title); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Log, LOGGER_LEVEL, LOGGER_LEVEL_ERROR, LOGGER_LEVEL_INFO, LOGGER_LEVEL_WARN } from '@App/model/do/logger'; | ||
import { LoggerModel } from '@App/model/logger'; | ||
import { Logger } from './logger'; | ||
|
||
export class DBLogger implements Logger { | ||
public logger = new LoggerModel(); | ||
|
||
public Logger(level: LOGGER_LEVEL, origin: string, msg: string, title = '', scriptId?: number): Logger { | ||
const log: Log = { | ||
id: 0, | ||
level: level, | ||
message: msg, | ||
origin: origin, | ||
title: title, | ||
createtime: new Date().getTime(), | ||
}; | ||
if (scriptId) { | ||
log.scriptId = scriptId; | ||
} | ||
void this.logger.save(log); | ||
return this; | ||
} | ||
|
||
public Debug(origin: string, msg: string, title = '', scriptId?: number): Logger { | ||
console.log(origin + '-' + title + ': ' + msg, scriptId); | ||
return this; | ||
// return this.Logger(LOGGER_LEVEL_DEBUG, origin, msg, title); | ||
} | ||
|
||
public Info(origin: string, msg: string, title = '', scriptId?: number): Logger { | ||
return this.Logger(LOGGER_LEVEL_INFO, origin, msg, title, scriptId); | ||
} | ||
|
||
public Warn(origin: string, msg: string, title = '', scriptId?: number): Logger { | ||
return this.Logger(LOGGER_LEVEL_WARN, origin, msg, title, scriptId); | ||
} | ||
|
||
public Error(origin: string, msg: string, title = '', scriptId?: number): Logger { | ||
return this.Logger(LOGGER_LEVEL_ERROR, origin, msg, title, scriptId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.