mirror of
https://github.com/servo/servo.git
synced 2025-07-26 00:30:22 +01:00
Console.Clear implemented
This commit is contained in:
parent
332c9cc12f
commit
d8b6755a8d
4 changed files with 9 additions and 0 deletions
|
@ -272,6 +272,7 @@ impl ConsoleActor {
|
||||||
LogLevel::Info => "info",
|
LogLevel::Info => "info",
|
||||||
LogLevel::Warn => "warn",
|
LogLevel::Warn => "warn",
|
||||||
LogLevel::Error => "error",
|
LogLevel::Error => "error",
|
||||||
|
LogLevel::Clear => "clear",
|
||||||
_ => "log",
|
_ => "log",
|
||||||
}
|
}
|
||||||
.to_owned();
|
.to_owned();
|
||||||
|
|
|
@ -246,6 +246,7 @@ pub enum LogLevel {
|
||||||
Info,
|
Info,
|
||||||
Warn,
|
Warn,
|
||||||
Error,
|
Error,
|
||||||
|
Clear,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
|
|
|
@ -72,6 +72,12 @@ impl Console {
|
||||||
console_messages(global, &messages, LogLevel::Log)
|
console_messages(global, &messages, LogLevel::Log)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://developer.mozilla.org/en-US/docs/Web/API/Console/clear
|
||||||
|
pub fn Clear(global: &GlobalScope) {
|
||||||
|
let message: Vec<DOMString> = Vec::new();
|
||||||
|
console_messages(global, &message, LogLevel::Clear)
|
||||||
|
}
|
||||||
|
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/API/Console
|
// https://developer.mozilla.org/en-US/docs/Web/API/Console
|
||||||
pub fn Debug(global: &GlobalScope, messages: Vec<DOMString>) {
|
pub fn Debug(global: &GlobalScope, messages: Vec<DOMString>) {
|
||||||
console_messages(global, &messages, LogLevel::Debug)
|
console_messages(global, &messages, LogLevel::Debug)
|
||||||
|
|
|
@ -15,6 +15,7 @@ namespace console {
|
||||||
void warn(DOMString... messages);
|
void warn(DOMString... messages);
|
||||||
void error(DOMString... messages);
|
void error(DOMString... messages);
|
||||||
void assert(boolean condition, optional DOMString message);
|
void assert(boolean condition, optional DOMString message);
|
||||||
|
void clear();
|
||||||
|
|
||||||
// Grouping
|
// Grouping
|
||||||
void group(DOMString... data);
|
void group(DOMString... data);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue