mirror of https://github.com/status-im/codimd.git
Merge pull request #1054 from SISheogorath/fix/otLogging
Fix logging in ot module
This commit is contained in:
commit
df2a2e6c6c
|
@ -44,7 +44,7 @@ EditorSocketIOServer.prototype.addClient = function (socket) {
|
||||||
socket.origin = 'operation';
|
socket.origin = 'operation';
|
||||||
self.mayWrite(socket, function (mayWrite) {
|
self.mayWrite(socket, function (mayWrite) {
|
||||||
if (!mayWrite) {
|
if (!mayWrite) {
|
||||||
console.log("User doesn't have the right to edit.");
|
logger.info("User doesn't have the right to edit.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -71,14 +71,14 @@ EditorSocketIOServer.prototype.addClient = function (socket) {
|
||||||
socket.origin = 'selection';
|
socket.origin = 'selection';
|
||||||
self.mayWrite(socket, function (mayWrite) {
|
self.mayWrite(socket, function (mayWrite) {
|
||||||
if (!mayWrite) {
|
if (!mayWrite) {
|
||||||
console.log("User doesn't have the right to edit.");
|
logger.info("User doesn't have the right to edit.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
self.updateSelection(socket, obj && Selection.fromJSON(obj));
|
self.updateSelection(socket, obj && Selection.fromJSON(obj));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
socket.on('disconnect', function () {
|
socket.on('disconnect', function () {
|
||||||
//console.log("Disconnect");
|
logger.debug("Disconnect");
|
||||||
socket.leave(self.docId);
|
socket.leave(self.docId);
|
||||||
self.onDisconnect(socket);
|
self.onDisconnect(socket);
|
||||||
/*
|
/*
|
||||||
|
@ -106,7 +106,7 @@ EditorSocketIOServer.prototype.onOperation = function (socket, revision, operati
|
||||||
var clientId = socket.id;
|
var clientId = socket.id;
|
||||||
var wrappedPrime = this.receiveOperation(revision, wrapped);
|
var wrappedPrime = this.receiveOperation(revision, wrapped);
|
||||||
if(!wrappedPrime) return;
|
if(!wrappedPrime) return;
|
||||||
//console.log("new operation: " + JSON.stringify(wrapped));
|
logger.debug("new operation: " + JSON.stringify(wrapped));
|
||||||
this.getClient(clientId).selection = wrappedPrime.meta;
|
this.getClient(clientId).selection = wrappedPrime.meta;
|
||||||
revision = this.operations.length;
|
revision = this.operations.length;
|
||||||
socket.emit('ack', revision);
|
socket.emit('ack', revision);
|
||||||
|
@ -161,4 +161,4 @@ EditorSocketIOServer.prototype.onDisconnect = function (socket) {
|
||||||
socket.broadcast.to(this.docId).emit('client_left', clientId);
|
socket.broadcast.to(this.docId).emit('client_left', clientId);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = EditorSocketIOServer;
|
module.exports = EditorSocketIOServer;
|
||||||
|
|
Loading…
Reference in New Issue