replace char*/string with stringview
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
#include "lib/OutStream.h"
|
||||
#include "lib/SpinLock.h"
|
||||
#include "user/lib/String.h"
|
||||
#include "user/lib/StringView.h"
|
||||
|
||||
class Logger : public OutStream {
|
||||
public:
|
||||
@ -19,7 +20,7 @@ private:
|
||||
static bool kout_enabled;
|
||||
static bool serial_enabled;
|
||||
|
||||
void log(const char* message, CGA::color col) const;
|
||||
void log(const bse::string_view message, CGA::color col) const;
|
||||
|
||||
friend class NamedLogger; // Allow NamedLogger to lock/unlock
|
||||
|
||||
@ -46,21 +47,17 @@ public:
|
||||
|
||||
void flush() override;
|
||||
|
||||
void trace(const char* message) const;
|
||||
void trace(const bse::string& message) const;
|
||||
void debug(const char* message) const;
|
||||
void debug(const bse::string& message) const;
|
||||
void error(const char* message) const;
|
||||
void error(const bse::string& message) const;
|
||||
void info(const char* message) const;
|
||||
void info(const bse::string& message) const;
|
||||
void trace(const bse::string_view message) const;
|
||||
void debug(const bse::string_view message) const;
|
||||
void error(const bse::string_view message) const;
|
||||
void info(const bse::string_view message) const;
|
||||
|
||||
// TODO: Make lvl change accessible over menu
|
||||
static void set_level(LogLevel lvl) {
|
||||
Logger::level = lvl;
|
||||
}
|
||||
|
||||
static char* level_to_string(LogLevel lvl) {
|
||||
static bse::string_view level_to_string(LogLevel lvl) {
|
||||
switch (lvl) {
|
||||
case Logger::TRACE:
|
||||
return "TRACE";
|
||||
|
||||
Reference in New Issue
Block a user