-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add line handling in fb_printStr #196
Changes from 8 commits
384a97c
9a9af6e
48b8810
2922d77
75b36a9
2521c2c
70da79a
40ac13d
3cfb6ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ bool useVgaOutput; | |
void init_log(size_t defaultOutputs, log_level_t trimBelowLevel, bool useVgaVideo){ | ||
if (defaultOutputs == LOG_OUTPUT_DONT_CARE) | ||
defaultOutputs = LOG_OUTPUT_SERIAL; //default to serial | ||
|
||
logDestBitmap = defaultOutputs; | ||
logTrimLevel = trimBelowLevel; | ||
|
||
|
@@ -48,7 +48,7 @@ void set_log_trim_level(size_t newTrim){ | |
void logline(log_level_t level, const char* msg){ | ||
if (level < logTrimLevel) | ||
return; //dont log things that we dont want to see for now. (would be nice to store these somewhere in the future perhaps, just not display them?) | ||
|
||
for (size_t i = 0; i < LOG_OUTPUT_COUNT; i++){ | ||
if ((logDestBitmap & (1 << i)) == 0) | ||
continue; //bit is cleared, we should not log there | ||
|
@@ -74,15 +74,16 @@ void logline(log_level_t level, const char* msg){ | |
fbCurrentLine++; | ||
} | ||
else { | ||
_fb_printStr(logLevelStrings[level], 0, fbCurrentLine, 0xFFFFFFFF, 0); | ||
_fb_printStr(msg, logLevelStrLen, fbCurrentLine, 0xFFFFFFFF, 0); | ||
//TODO: fbCurrentLine should be aligned with cur_fbLine in the framebuffer case. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm yeah, this is an interesting one - I remember doing that because there no state tracking a current line number for the terminal output. |
||
_fb_printStrAt(logLevelStrings[level], 0, fbCurrentLine, 0xFFFFFFFF, 0); | ||
_fb_printStrAt(msg, logLevelStrLen, fbCurrentLine, 0xFFFFFFFF, 0); | ||
fbCurrentLine++; | ||
} | ||
|
||
if (fbCurrentLine > fbMaxLine) | ||
fbCurrentLine = 0; | ||
break; | ||
|
||
default: | ||
continue; | ||
} | ||
|
@@ -98,7 +99,7 @@ void logline(log_level_t level, const char* msg){ | |
void loglinef(log_level_t level, const char* msg, ...) | ||
{ | ||
char format_buffer[formatBufferLen]; | ||
|
||
va_list format_args; | ||
va_start(format_args, msg); | ||
vsprintf(format_buffer, msg, format_args); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt this be
>=
?