Fix logging in ot module

Seems like there was some debugging going on some day, this patch should
make sure the right logging is used.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
Sheogorath 2018-11-13 22:59:50 +01:00
parent 54d3d930cf
commit 694fb37aea
No known key found for this signature in database
GPG key ID: 1F05CC3635CDDFFD

View file

@ -44,7 +44,7 @@ EditorSocketIOServer.prototype.addClient = function (socket) {
socket.origin = 'operation';
self.mayWrite(socket, function (mayWrite) {
if (!mayWrite) {
console.log("User doesn't have the right to edit.");
logger.info("User doesn't have the right to edit.");
return;
}
try {
@ -71,14 +71,14 @@ EditorSocketIOServer.prototype.addClient = function (socket) {
socket.origin = 'selection';
self.mayWrite(socket, function (mayWrite) {
if (!mayWrite) {
console.log("User doesn't have the right to edit.");
logger.info("User doesn't have the right to edit.");
return;
}
self.updateSelection(socket, obj && Selection.fromJSON(obj));
});
});
socket.on('disconnect', function () {
//console.log("Disconnect");
logger.debug("Disconnect");
socket.leave(self.docId);
self.onDisconnect(socket);
/*
@ -106,7 +106,7 @@ EditorSocketIOServer.prototype.onOperation = function (socket, revision, operati
var clientId = socket.id;
var wrappedPrime = this.receiveOperation(revision, wrapped);
if(!wrappedPrime) return;
//console.log("new operation: " + JSON.stringify(wrapped));
logger.debug("new operation: " + JSON.stringify(wrapped));
this.getClient(clientId).selection = wrappedPrime.meta;
revision = this.operations.length;
socket.emit('ack', revision);
@ -161,4 +161,4 @@ EditorSocketIOServer.prototype.onDisconnect = function (socket) {
socket.broadcast.to(this.docId).emit('client_left', clientId);
};
module.exports = EditorSocketIOServer;
module.exports = EditorSocketIOServer;