Improve logging configuration structure
This commit is contained in:
parent
b736f5f6cb
commit
8210642684
@ -1,10 +1,13 @@
|
|||||||
module.exports = {
|
export default {
|
||||||
app: {
|
app: {
|
||||||
name: 'Example App',
|
name: 'Example App',
|
||||||
contact_email: 'contact@example.net'
|
contact_email: 'contact@example.net'
|
||||||
},
|
},
|
||||||
log_level: "DEV",
|
log: {
|
||||||
db_log_level: "ERROR",
|
level: "DEBUG",
|
||||||
|
verbose: true,
|
||||||
|
db_level: "ERROR",
|
||||||
|
},
|
||||||
base_url: "http://localhost:4899",
|
base_url: "http://localhost:4899",
|
||||||
public_websocket_url: "ws://localhost:4899",
|
public_websocket_url: "ws://localhost:4899",
|
||||||
listen_addr: '127.0.0.1',
|
listen_addr: '127.0.0.1',
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
module.exports = {
|
export default {
|
||||||
log_level: "DEBUG",
|
log: {
|
||||||
db_log_level: "ERROR",
|
level: "DEV",
|
||||||
|
verbose: false,
|
||||||
|
db_level: "ERROR",
|
||||||
|
},
|
||||||
base_url: "https://watch-my.stream",
|
base_url: "https://watch-my.stream",
|
||||||
public_websocket_url: "wss://watch-my.stream",
|
public_websocket_url: "wss://watch-my.stream",
|
||||||
session: {
|
session: {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
module.exports = {
|
export default {
|
||||||
mysql: {
|
mysql: {
|
||||||
host: "localhost",
|
host: "localhost",
|
||||||
user: "root",
|
user: "root",
|
||||||
|
@ -4,9 +4,9 @@ import Log from "./models/Log";
|
|||||||
import {bufferToUUID} from "./Utils";
|
import {bufferToUUID} from "./Utils";
|
||||||
|
|
||||||
export default class Logger {
|
export default class Logger {
|
||||||
private static logLevel: LogLevelKeys = <LogLevelKeys>config.get<string>('log_level');
|
private static logLevel: LogLevelKeys = <LogLevelKeys>config.get<string>('log.level');
|
||||||
private static dbLogLevel: LogLevelKeys = <LogLevelKeys>config.get<string>('db_log_level');
|
private static dbLogLevel: LogLevelKeys = <LogLevelKeys>config.get<string>('log.db_level');
|
||||||
private static verboseMode: boolean = false;
|
private static verboseMode: boolean = config.get<boolean>('log.verbose');
|
||||||
|
|
||||||
public static verbose() {
|
public static verbose() {
|
||||||
this.verboseMode = true;
|
this.verboseMode = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user