| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * Module for sending log entries to the server. | 7 * Module for sending log entries to the server. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 'use strict'; | 10 'use strict'; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 * @private | 173 * @private |
| 174 * @param {remoting.ServerLogEntry} entry | 174 * @param {remoting.ServerLogEntry} entry |
| 175 */ | 175 */ |
| 176 remoting.LogToServer.prototype.log_ = function(entry) { | 176 remoting.LogToServer.prototype.log_ = function(entry) { |
| 177 // Log the time taken to get to this point from the time this session started. | 177 // Log the time taken to get to this point from the time this session started. |
| 178 // Exclude time taken for authorization. | 178 // Exclude time taken for authorization. |
| 179 var sessionDurationInSeconds = | 179 var sessionDurationInSeconds = |
| 180 (new Date().getTime() - this.sessionStartTime_ - | 180 (new Date().getTime() - this.sessionStartTime_ - |
| 181 this.authTotalTime_) / 1000.0; | 181 this.authTotalTime_) / 1000.0; |
| 182 entry.addSessionDuration(sessionDurationInSeconds); | 182 entry.addSessionDuration(sessionDurationInSeconds); |
| 183 entry.addApplicationId(); |
| 183 // The host-version will be blank for logs before a session has been created. | 184 // The host-version will be blank for logs before a session has been created. |
| 184 // For example, the signal-strategy log-entries won't have host version info. | 185 // For example, the signal-strategy log-entries won't have host version info. |
| 185 entry.addHostVersion(this.hostVersion_); | 186 entry.addHostVersion(this.hostVersion_); |
| 186 | 187 |
| 187 // Send the stanza to the debug log. | 188 // Send the stanza to the debug log. |
| 188 console.log('Enqueueing log entry:'); | 189 console.log('Enqueueing log entry:'); |
| 189 entry.toDebugLog(1); | 190 entry.toDebugLog(1); |
| 190 | 191 |
| 191 var stanza = '<cli:iq to="' + remoting.settings.DIRECTORY_BOT_JID + '" ' + | 192 var stanza = '<cli:iq to="' + remoting.settings.DIRECTORY_BOT_JID + '" ' + |
| 192 'type="set" xmlns:cli="jabber:client">' + | 193 'type="set" xmlns:cli="jabber:client">' + |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 }; | 267 }; |
| 267 | 268 |
| 268 /** | 269 /** |
| 269 * @param {string} hostVersion Version of the host for current session. | 270 * @param {string} hostVersion Version of the host for current session. |
| 270 * @return {void} Nothing. | 271 * @return {void} Nothing. |
| 271 */ | 272 */ |
| 272 remoting.LogToServer.prototype.setHostVersion = function(hostVersion) { | 273 remoting.LogToServer.prototype.setHostVersion = function(hostVersion) { |
| 273 this.hostVersion_ = hostVersion; | 274 this.hostVersion_ = hostVersion; |
| 274 }; | 275 }; |
| 275 | 276 |
| OLD | NEW |