Skip to content

Commit

Permalink
Release of Resonate 0.2.0-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
98ahni authored Jul 19, 2024
1 parent 06b2da4 commit d5f66a9
Showing 1 changed file with 50 additions and 36 deletions.
86 changes: 50 additions & 36 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,49 +35,63 @@
const default_console_log = console.log;
const default_console_warn = console.warn;
const default_console_error = console.error;
const reset_console_functions = ()=>{
console.log = default_console_log;
console.warn = default_console_warn;
console.error = default_console_error;
};
console.log = (...data) => {
fetch("/console", {
method: "POST",
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({type: 'log', data})
}).then(
/*resolve*/()=>{},
/*reject*/()=>{
// No server, restore functions
console.log = default_console_log;
console.warn = default_console_warn;
console.error = default_console_error;
});
try{
fetch("/console", {
method: "POST",
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({type: 'log', data})
}).then(
/*resolve*/()=>{},
/*reject*/()=>{
// No server, restore functions
reset_console_functions();
});
}
catch(e){
reset_console_functions();
}
default_console_log.apply(console, data);
};
console.warn = (...data) => {
fetch("/console", {
method: "POST",
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({type: 'warn', data})
}).then(
/*resolve*/()=>{},
/*reject*/()=>{
// No server, restore functions
console.log = default_console_log;
console.warn = default_console_warn;
console.error = default_console_error;
});
try{
fetch("/console", {
method: "POST",
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({type: 'warn', data})
}).then(
/*resolve*/()=>{},
/*reject*/()=>{
// No server, restore functions
reset_console_functions();
});
}
catch(e){
reset_console_functions();
}
default_console_warn.apply(console, data);
};
console.error = (...data) => {
fetch("/console", {
method: "POST",
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({type: 'error', data})
}).then(
/*resolve*/()=>{},
/*reject*/()=>{
// No server, restore functions
console.log = default_console_log;
console.warn = default_console_warn;
console.error = default_console_error;
});
try{
fetch("/console", {
method: "POST",
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({type: 'error', data})
}).then(
/*resolve*/()=>{},
/*reject*/()=>{
// No server, restore functions
reset_console_functions();
});
}
catch(e){
reset_console_functions();
}
default_console_error.apply(console, data);
};
</script>
Expand Down

0 comments on commit d5f66a9

Please sign in to comment.