Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(686)

Unified Diff: remoting/client/plugin/chromoting_instance.cc

Issue 6621018: Convert Chromoting plugin logging to appear in client UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/client/plugin/chromoting_instance.cc
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index 0cdfe62fd0b436081a21bb8692d66d5004d183e2..6905ff83da106f376381cb9a890981654b60fb84 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -101,6 +101,7 @@ void ChromotingInstance::Connect(const ClientConfig& config) {
// Kick off the connection.
client_->Start();
+ LogDebugInfo("Connection status: Initializing");
GetScriptableObject()->SetConnectionInfo(STATUS_INITIALIZING,
QUALITY_UNKNOWN);
}
@@ -113,6 +114,7 @@ void ChromotingInstance::Disconnect() {
client_->Stop();
}
+ LogDebugInfo("Connection status: Closed");
GetScriptableObject()->SetConnectionInfo(STATUS_CLOSED, QUALITY_UNKNOWN);
}
@@ -122,8 +124,8 @@ void ChromotingInstance::ViewChanged(const pp::Rect& position,
// TODO(ajwong): This is going to be a race condition when the view changes
// and we're in the middle of a Paint().
- VLOG(1) << "ViewChanged " << position.x() << "," << position.y() << ","
- << position.width() << "," << position.height();
+ LogDebugInfo(StringPrintf("ViewChanged: %d,%d %dx%d", position.x(),
+ position.y(), position.width(), position.height()));
view_->SetViewport(position.x(), position.y(),
position.width(), position.height());
@@ -187,7 +189,7 @@ ChromotingScriptableObject* ChromotingInstance::GetScriptableObject() {
DCHECK(so != NULL);
return static_cast<ChromotingScriptableObject*>(so);
}
- LOG(ERROR) << "Unable to get ScriptableObject for Chromoting plugin.";
+ LogDebugError("Unable to get ScriptableObject for Chromoting plugin.");
return NULL;
}
@@ -205,9 +207,21 @@ void ChromotingInstance::SubmitLoginInfo(const std::string& username,
}
void ChromotingInstance::LogDebugInfo(const std::string& info) {
+ LOG(INFO) << info;
GetScriptableObject()->LogDebugInfo(info);
}
+void ChromotingInstance::LogDebugWarning(const std::string& info) {
+ LOG(WARNING) << info;
+ GetScriptableObject()->LogDebugInfo(
+ StringPrintf("WARNING : %s", info.c_str()));
+}
+
+void ChromotingInstance::LogDebugError(const std::string& info) {
+ LOG(ERROR) << info;
+ GetScriptableObject()->LogDebugInfo(StringPrintf("ERROR : %s", info.c_str()));
+}
+
pp::Var ChromotingInstance::GetInstanceObject() {
if (instance_object_.is_undefined()) {
ChromotingScriptableObject* object = new ChromotingScriptableObject(this);

Powered by Google App Engine
This is Rietveld 408576698