20 #include "pedigree/kernel/debugger/commands/LogViewer.h" 21 #include "pedigree/kernel/Log.h" 22 #include "pedigree/kernel/debugger/DebuggerIO.h" 42 pScreen->disableCli();
46 resize(pScreen->
getWidth(), pScreen->getHeight() - 2);
47 setScrollKeys(
'j',
'k');
51 ' ', 0, 0, pScreen->
getWidth() - 1, DebuggerIO::White,
56 "Pedigree debugger - Log viewer", 0, 0, DebuggerIO::White,
64 ' ', pScreen->getHeight() - 1, 0, pScreen->
getWidth() - 1,
65 DebuggerIO::White, DebuggerIO::Green);
70 "j: Up one line. k: Down one line. backspace: Page up. space: Page " 72 pScreen->getHeight() - 1, 0, DebuggerIO::White, DebuggerIO::Green);
74 "j", pScreen->getHeight() - 1, 0, DebuggerIO::Yellow,
77 "k", pScreen->getHeight() - 1, 16, DebuggerIO::Yellow,
80 "backspace", pScreen->getHeight() - 1, 34, DebuggerIO::Yellow,
83 "space", pScreen->getHeight() - 1, 54, DebuggerIO::Yellow,
86 "q", pScreen->getHeight() - 1, 72, DebuggerIO::Yellow,
97 while (!(c = pScreen->
getChar()))
106 scroll(static_cast<ssize_t>(height()));
108 scroll(-static_cast<ssize_t>(height()));
117 pScreen->
drawString(
" ", 1, 0, DebuggerIO::White, DebuggerIO::Black);
122 const char *LogViewer::getLine1(
134 Line.append(entry.
timestamp, 10, 8,
'0');
140 Line.append(entry.
timestamp, 10, 8,
'0');
146 colour = DebuggerIO::White;
150 colour = DebuggerIO::LightBlue;
153 colour = DebuggerIO::Green;
156 colour = DebuggerIO::Yellow;
159 colour = DebuggerIO::Magenta;
162 colour = DebuggerIO::Red;
168 const char *LogViewer::getLine2(
179 Line.append(entry.
str);
184 Line.append(entry.
str);
187 colour = DebuggerIO::White;
191 size_t LogViewer::getLineCount()
virtual size_t getWidth()=0
virtual void enableCli()=0
StaticString< LOG_LENGTH > str
size_t getStaticEntryCount() const
const StaticLogEntry & getStaticEntry(size_t n) const
const DynamicLogEntry & getDynamicEntry(size_t n) const
size_t getDynamicEntryCount() const
virtual void drawString(const char *str, size_t row, size_t col, Colour foreColour, Colour backColour)=0
static EXPORTED_PUBLIC Log & instance()
virtual void drawHorizontalLine(char c, size_t row, size_t colStart, size_t colEnd, Colour foreColour, Colour backColour)=0
bool execute(const HugeStaticString &input, HugeStaticString &output, InterruptState &state, DebuggerIO *screen)
void autocomplete(const HugeStaticString &input, HugeStaticString &output)