mirror of
https://codeberg.org/TicklishHoneyBee/CLIte.git
synced 2026-03-11 09:04:37 +00:00
write pre-vfs logs to logfile
This commit is contained in:
parent
b070abf90d
commit
f2be72edc1
1 changed files with 5 additions and 0 deletions
|
|
@ -1345,6 +1345,7 @@ clite.vfs = {
|
|||
};
|
||||
|
||||
clite.log = {
|
||||
logs:[],
|
||||
init:function(vfs) {
|
||||
clite.log.write = function(txt) {
|
||||
if (!clite.user.hasLogin() || (typeof clite.init == 'number' && clite.init != 3)) {
|
||||
|
|
@ -1357,9 +1358,13 @@ clite.log = {
|
|||
n.data.content += txt+'\n';
|
||||
console.log(txt);
|
||||
}
|
||||
var n = vfs.getNode('/var/logs');
|
||||
if (n)
|
||||
n.data.content = clite.log.logs.join('\n')+'\n';
|
||||
clite.core.execSafeAsync(function(){clite.log.init = null;});
|
||||
},
|
||||
write:function(txt) {
|
||||
clite.log.logs.push(txt);
|
||||
try {
|
||||
clite.term.writeLine(txt);
|
||||
} catch(e) {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue