mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-09 04:22:04 -04:00
Cleanup log functions
This commit is contained in:
parent
db68e3003e
commit
85ec3e9b0a
@ -29,11 +29,6 @@ void log(log_level level, const char* s);
|
||||
void log(log_level level, const std::string& s);
|
||||
void logf(log_level level, const char* s, ...);
|
||||
|
||||
//TODO Deprecate theses
|
||||
void log(const char* s);
|
||||
void logf(const char* s, ...);
|
||||
void log(const std::string& s);
|
||||
|
||||
} //end of namespace logging
|
||||
|
||||
#endif
|
||||
|
@ -88,45 +88,6 @@ void logging::to_file(){
|
||||
}
|
||||
}
|
||||
|
||||
void logging::log(const char* s){
|
||||
if(!is_early()){
|
||||
//TODO Display the string in the kernel terminal
|
||||
}
|
||||
|
||||
if(is_file()){
|
||||
append_to_file(s, std::str_len(s));
|
||||
} else {
|
||||
thor_assert(current_early < MAX_EARLY, "early log buffer is full");
|
||||
|
||||
early_logs[current_early++] = s;
|
||||
}
|
||||
}
|
||||
|
||||
void logging::logf(const char* format, ...){
|
||||
thor_assert(!is_early(), "log(string) in only valid in normal mode");
|
||||
thor_assert(is_file(), "log(string) in only valid file mode");
|
||||
|
||||
//TODO Display the string in the kernel terminal
|
||||
|
||||
va_list va;
|
||||
va_start(va, format);
|
||||
|
||||
auto s = vsprintf(format, va);
|
||||
|
||||
va_end(va);
|
||||
|
||||
append_to_file(s.c_str(), s.size());
|
||||
}
|
||||
|
||||
void logging::log(const std::string& s){
|
||||
thor_assert(!is_early(), "log(string) in only valid in normal mode");
|
||||
thor_assert(is_file(), "log(string) in only valid file mode");
|
||||
|
||||
//TODO Display the string in the kernel terminal
|
||||
|
||||
append_to_file(s.c_str(), s.size());
|
||||
}
|
||||
|
||||
void logging::log(log_level level, const char* s){
|
||||
//First, print to the virtual debugger
|
||||
virtual_debug(level_to_string(level));
|
||||
|
Loading…
x
Reference in New Issue
Block a user