logs: on the server, use template literals when possible
It's just synctactic sugar, but it is always better than executing string concatenations in one's mind. Do not do this with files in src/static, because we want to keep IE 11 compatibility.pull/3476/head
parent
0e972aaecf
commit
27b3b0ecd2
|
@ -353,7 +353,7 @@ function listSessionsWithDBKey (dbkey, callback)
|
|||
{
|
||||
if (err == "apierror: sessionID does not exist")
|
||||
{
|
||||
console.warn("Found bad session " + sessionID + " in " + dbkey + ".");
|
||||
console.warn(`Found bad session ${sessionID} in ${dbkey}`);
|
||||
}
|
||||
else if(ERR(err, callback))
|
||||
{
|
||||
|
|
|
@ -12,15 +12,15 @@ var serverName;
|
|||
exports.createServer = function () {
|
||||
console.log("Report bugs at https://github.com/ether/etherpad-lite/issues")
|
||||
|
||||
serverName = "Etherpad " + settings.getGitCommit() + " (http://etherpad.org)";
|
||||
serverName = `Etherpad ${settings.getGitCommit()} (http://etherpad.org)`;
|
||||
|
||||
console.log("Your Etherpad version is " + settings.getEpVersion() + " (" + settings.getGitCommit() + ")");
|
||||
console.log(`Your Etherpad version is ${settings.getEpVersion()} (${settings.getGitCommit()})`);
|
||||
|
||||
exports.restartServer();
|
||||
|
||||
console.log("You can access your Etherpad instance at http://" + settings.ip + ":" + settings.port + "/");
|
||||
console.log(`You can access your Etherpad instance at http://${settings.ip}:${settings.port}/`);
|
||||
if(!_.isEmpty(settings.users)){
|
||||
console.log("The plugin admin page is at http://" + settings.ip + ":" + settings.port + "/admin/plugins");
|
||||
console.log(`The plugin admin page is at http://${settings.ip}:${settings.port}/admin/plugins`);
|
||||
}
|
||||
else{
|
||||
console.warn("Admin username and password not set in settings.json. To access admin please uncomment and edit 'users' in settings.json");
|
||||
|
@ -42,9 +42,9 @@ exports.restartServer = function () {
|
|||
|
||||
if (settings.ssl) {
|
||||
|
||||
console.log( "SSL -- enabled");
|
||||
console.log( "SSL -- server key file: " + settings.ssl.key );
|
||||
console.log( "SSL -- Certificate Authority's certificate file: " + settings.ssl.cert );
|
||||
console.log("SSL -- enabled");
|
||||
console.log(`SSL -- server key file: ${settings.ssl.key}`);
|
||||
console.log(`SSL -- Certificate Authority's certificate file: ${settings.ssl.cert}`);
|
||||
|
||||
var options = {
|
||||
key: fs.readFileSync( settings.ssl.key ),
|
||||
|
|
|
@ -52,7 +52,7 @@ if(os.type().indexOf("Windows") > -1)
|
|||
abiword.on('exit', function (code)
|
||||
{
|
||||
if(code != 0) {
|
||||
return callback("Abiword died with exit code " + code);
|
||||
return callback(`Abiword died with exit code ${code}`);
|
||||
}
|
||||
|
||||
if(stdoutBuffer != "")
|
||||
|
@ -91,7 +91,7 @@ else
|
|||
abiword.on('exit', function (code)
|
||||
{
|
||||
spawnAbiword();
|
||||
stdoutCallback("Abiword died with exit code " + code);
|
||||
stdoutCallback(`Abiword died with exit code ${code}`);
|
||||
});
|
||||
|
||||
//delegate the processing of stdout to a other function
|
||||
|
|
|
@ -84,7 +84,7 @@ function doConvertTask(task, callback) {
|
|||
// Throw an exception if libreoffice failed
|
||||
soffice.on('exit', function(code) {
|
||||
if (code != 0) {
|
||||
return callback("LibreOffice died with exit code " + code + " and message: " + stdoutBuffer);
|
||||
return callback(`LibreOffice died with exit code ${code} and message: ${stdoutBuffer}`);
|
||||
}
|
||||
|
||||
callback();
|
||||
|
|
|
@ -396,7 +396,7 @@ exports.reloadSettings = function reloadSettings() {
|
|||
//test if the setting start with a lowercase character
|
||||
if(i.charAt(0).search("[a-z]") !== 0)
|
||||
{
|
||||
console.warn("Settings should start with a lowercase character: '" + i + "'");
|
||||
console.warn(`Settings should start with a lowercase character: '${i}'`);
|
||||
}
|
||||
|
||||
//we know this setting, so we overwrite it
|
||||
|
@ -412,7 +412,7 @@ exports.reloadSettings = function reloadSettings() {
|
|||
//this setting is unkown, output a warning and throw it away
|
||||
else
|
||||
{
|
||||
console.warn("Unknown Setting: '" + i + "'. This setting doesn't exist or it was removed");
|
||||
console.warn(`Unknown Setting: '${i}'. This setting doesn't exist or it was removed`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -422,7 +422,7 @@ exports.reloadSettings = function reloadSettings() {
|
|||
//test if the setting start with a lowercase character
|
||||
if(i.charAt(0).search("[a-z]") !== 0)
|
||||
{
|
||||
console.warn("Settings should start with a lowercase character: '" + i + "'");
|
||||
console.warn(`Settings should start with a lowercase character: '${i}'`);
|
||||
}
|
||||
|
||||
//we know this setting, so we overwrite it
|
||||
|
@ -438,7 +438,7 @@ exports.reloadSettings = function reloadSettings() {
|
|||
//this setting is unkown, output a warning and throw it away
|
||||
else
|
||||
{
|
||||
console.warn("Unknown Setting: '" + i + "'. This setting doesn't exist or it was removed");
|
||||
console.warn(`Unknown Setting: '${i}'. This setting doesn't exist or it was removed`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue