diff options
Diffstat (limited to 'Source/Kernel/Core/Log.ns.cpp')
-rw-r--r-- | Source/Kernel/Core/Log.ns.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Kernel/Core/Log.ns.cpp b/Source/Kernel/Core/Log.ns.cpp index 1727024..d51aa55 100644 --- a/Source/Kernel/Core/Log.ns.cpp +++ b/Source/Kernel/Core/Log.ns.cpp @@ -1,4 +1,6 @@ #include "Log.ns.h" +#include <FileSystems/RamFS/RamFS.class.h> +#include <VTManager/SimpleVT.class.h> #include <VFS/VFS.ns.h> namespace Log { @@ -11,6 +13,10 @@ void init(u8int loglevel) { if (VFS::find("/System/Logs") == 0) VFS::createDirectory("/System/Logs"); logs[KL_PANIC] = new TextFile("/System/Logs/Panic.log", FM_APPEND); + if (!logs[KL_PANIC]->valid()) { //FS maybee not read/write, mount a ramfs + VFS::mount("/System/Logs:ramfs", kvt); + logs[KL_PANIC] = new TextFile("/System/Logs/Panic.log", FM_APPEND); + } if (KL_CRITICAL <= loglevel) logs[KL_CRITICAL] = new TextFile("/System/Logs/Critical.log", FM_APPEND); if (KL_ERROR <= loglevel) logs[KL_ERROR] = new TextFile("/System/Logs/Error.log", FM_APPEND); if (KL_WARNING <= loglevel) logs[KL_WARNING] = new TextFile("/System/Logs/Warning.log", FM_APPEND); |