constellation: clean up logging of pipelines and browsing contexts (#30657)

* constellation: clean up logging of pipelines and browsing contexts

* bring back sentence case; remove commented code

* fix more typos and wordings
This commit is contained in:
Delan Azabani 2023-11-14 12:53:31 +08:00 committed by GitHub
parent e620381736
commit 098e6a1580
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 190 additions and 316 deletions

File diff suppressed because it is too large Load diff

View file

@ -9,7 +9,7 @@ use std::thread;
use backtrace::Backtrace;
use compositing_traits::ConstellationMsg as FromCompositorMsg;
use crossbeam_channel::Sender;
use log::{debug, Level, LevelFilter, Log, Metadata, Record};
use log::{Level, LevelFilter, Log, Metadata, Record};
use msg::constellation_msg::TopLevelBrowsingContextId;
use script_traits::{LogEntry, ScriptMsg as FromScriptMsg, ScriptToConstellationChan};
use servo_remutex::ReentrantMutex;
@ -53,7 +53,6 @@ impl Log for FromScriptLogger {
fn log(&self, record: &Record) {
if let Some(entry) = log_entry(record) {
debug!("Sending log entry {:?}.", entry);
let thread_name = thread::current().name().map(ToOwned::to_owned);
let msg = FromScriptMsg::LogEntry(thread_name, entry);
let chan = self
@ -95,7 +94,6 @@ impl Log for FromCompositorLogger {
fn log(&self, record: &Record) {
if let Some(entry) = log_entry(record) {
debug!("Sending log entry {:?}.", entry);
let top_level_id = TopLevelBrowsingContextId::installed();
let thread_name = thread::current().name().map(ToOwned::to_owned);
let msg = FromCompositorMsg::LogEntry(top_level_id, thread_name, entry);

View file

@ -165,7 +165,7 @@ impl NetworkListener {
if self.should_send {
if let Err(e) = self.sender.send((self.pipeline_id, msg)) {
warn!(
"Failed to forward network message to pipeline {}: {:?}",
"Failed to forward network message to pipeline {:?}: {:?}",
self.pipeline_id, e
);
}

View file

@ -91,7 +91,7 @@ impl JointSessionHistory {
}
pub fn remove_entries_for_browsing_context(&mut self, context_id: BrowsingContextId) {
debug!("removing entries for context {}", context_id);
debug!("{}: Removing entries for browsing context", context_id);
self.past.retain(|diff| match diff {
SessionHistoryDiff::BrowsingContextDiff {
browsing_context_id,