This commit is contained in:
kodjomoustapha 2024-05-14 10:45:35 +01:00
parent a5e0185423
commit 281e621da3
2 changed files with 13 additions and 1 deletions

View file

@ -39,6 +39,18 @@ console.log = function (message) {
}
sendMessage("log", JSON.stringify([message.toString()]));
};
console.warn = function (message) {
if (typeof message === "object") {
message = JSON.stringify(message);
}
sendMessage("log", JSON.stringify([message.toString()]));
};
console.error = function (message) {
if (typeof message === "object") {
message = JSON.stringify(message);
}
sendMessage("log", JSON.stringify([message.toString()]));
};
String.prototype.substringAfter = function(pattern) {
const startIndex = this.indexOf(pattern);
if (startIndex === -1) return this.substring(0);

View file

@ -435,7 +435,7 @@ class _CodeEditorState extends ConsumerState<CodeEditor> {
final value = logs[index];
return SelectableText(value.$2,
style: TextStyle(
color: value.$1 == LoggerLevel.warning
color: value.$1 == LoggerLevel.info
? Colors.yellow
: Colors.blueAccent));
},