change logger
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
const { db, execQueryAsync, execQueryAsyncWithId } = require("./db.js");
|
||||
const { execQueryAsync, execQueryAsyncWithId } = require("./db.js");
|
||||
const { queryCcId, queryToId, queryFromId } = require("./utils/addressQueries.js");
|
||||
const DEBUG = require("../utils/debug").DEBUG;
|
||||
|
||||
async function registerAccount(userId, pwd, xoauth, xoauth2, host, port, tls) {
|
||||
const query = `
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
const mysql = require("mysql");
|
||||
const { logger } = require("../system/Logger");
|
||||
const MYSQL = require("./config.json").mysql;
|
||||
const DEBUG = require("../utils/debug.js").DEBUG;
|
||||
|
||||
|
||||
const db = mysql.createConnection({
|
||||
host: MYSQL.host,
|
||||
@@ -12,9 +11,9 @@ const db = mysql.createConnection({
|
||||
|
||||
db.connect(function (err) {
|
||||
if (err) {
|
||||
DEBUG.log("Impossible de se connecter", err.code);
|
||||
logger.error(`Unable to connect database ${err.code}`);
|
||||
} else {
|
||||
DEBUG.log("Database successfully connected");
|
||||
logger.log("Database successfully connected");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -45,7 +44,7 @@ function execQueryAsyncWithId(query, values) {
|
||||
function execQuery(query, values) {
|
||||
db.query(query, values, (err, results, fields) => {
|
||||
if (err) {
|
||||
DEBUG.log(err);
|
||||
logger.err(err);
|
||||
throw (err);
|
||||
}
|
||||
return results;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
const { execQueryAsync, execQueryAsyncWithId } = require("./db.js");
|
||||
const DEBUG = require("../utils/debug").DEBUG;
|
||||
|
||||
|
||||
async function getAddresseId(email, name) {
|
||||
const localpart = email.split("@")[0];
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
const { transformEmojis } = require("../utils/string.js");
|
||||
const { db, execQuery, execQueryAsync, execQueryAsyncWithId } = require("./db.js");
|
||||
const DEBUG = require("../utils/debug").DEBUG;
|
||||
|
||||
async function registerMessage(timestamp, rfc822size, messageId) {
|
||||
const query = `
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
const { transformEmojis } = require("../utils/string.js");
|
||||
const { db, execQueryAsync, execQueryAsyncWithId, execQuery } = require("./db.js");
|
||||
const { queryFromId, queryToId, queryCcId } = require("./utils/addressQueries.js");
|
||||
const DEBUG = require("../utils/debug").DEBUG;
|
||||
|
||||
async function createRoom(roomName, ownerId, messageId) {
|
||||
roomName = transformEmojis(roomName);
|
||||
|
||||
Reference in New Issue
Block a user