Add an optional context string for status line messges
This commit is contained in:
@@ -272,7 +272,7 @@ console::print(const wchar_t *fmt, ...)
|
||||
return result;
|
||||
}
|
||||
|
||||
status_line::status_line(const wchar_t *message) :
|
||||
status_line::status_line(const wchar_t *message, const wchar_t *context) :
|
||||
m_level(level_ok)
|
||||
{
|
||||
auto out = console::get().m_out;
|
||||
@@ -283,6 +283,12 @@ status_line::status_line(const wchar_t *message) :
|
||||
out->set_cursor_position(indent, m_line);
|
||||
out->set_attribute(uefi::attribute::light_gray);
|
||||
out->output_string(message);
|
||||
|
||||
if (context) {
|
||||
out->output_string(L": ");
|
||||
out->output_string(context);
|
||||
}
|
||||
|
||||
out->output_string(L"\r\n");
|
||||
|
||||
m_next = s_current;
|
||||
|
||||
@@ -35,7 +35,7 @@ private:
|
||||
class status_line
|
||||
{
|
||||
public:
|
||||
status_line(const wchar_t *message);
|
||||
status_line(const wchar_t *message, const wchar_t *context = nullptr);
|
||||
~status_line();
|
||||
|
||||
inline static void warn(const wchar_t *message, const wchar_t *error = nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user