parent
36c5966dea
commit
47f113efc6
@ -0,0 +1,10 @@ |
||||
module.exports = async client => { |
||||
const config = client.config; |
||||
try { |
||||
await mongoose.connect(`mongodb+srv://${config.database.user}:${config.database.password}@${config.database.cluster}.3jpp4.mongodb.net/test`, { |
||||
useFindAndModify: false, useNewUrlParser: true, dbName: 'Natsuki-Main', useUnifiedTopology: true, useCreateIndex: true |
||||
}).catch(() => {}); |
||||
} catch (e) { |
||||
|
||||
} |
||||
}; |
@ -0,0 +1,17 @@ |
||||
const config = require('../../json/config.json'); |
||||
const levels = require('./levels.json'); |
||||
const validStrings = Object.keys(levels); |
||||
|
||||
const getLevel = (level) => { |
||||
console.log(level) |
||||
if (typeof level === 'number') { |
||||
if (level <= 0) {return 0;} |
||||
if (level > 3) {return 3;} |
||||
return Math.floor(level); |
||||
} else { |
||||
const levelM = `${level}`.trim().toUpperCase(); |
||||
return validStrings.includes(levelM) ? levels[levelM] : typeof config.log.defaultLevel === 'number' ? getLevel(config.log.defaultLevel) : 1; |
||||
} |
||||
}; |
||||
|
||||
module.exports = getLevel; |
@ -0,0 +1,5 @@ |
||||
{ |
||||
"TOP": 0, |
||||
"STANDARD": 1, |
||||
"VERBOSE": 2 |
||||
} |
@ -0,0 +1,5 @@ |
||||
|
||||
|
||||
module.exports = (message, level, source, color) => { |
||||
|
||||
}; |
Loading…
Reference in new issue