Add padding to logging tags

master
rubenwardy 2017-05-27 02:24:53 +01:00
parent 67190ff228
commit 167fbc5773
3 changed files with 9 additions and 4 deletions

View File

@ -1,7 +1,7 @@
#include "utils.h"
#include "PL011.h"
void kprint(const char *cs) {
size_t kprint(const char *cs) {
size_t ptr = 0;
while (cs[ptr] != '\0') {
if (cs[ptr] != '\r') {
@ -9,13 +9,17 @@ void kprint(const char *cs) {
}
ptr++;
}
return ptr;
}
extern void kprintmod(const char *mod) {
kprint("[");
kprint(mod);
kprint("] ");
size_t res = kprint(mod);
for (int i = 0; i < 10 - res; i++) {
kprint(" ");
}
kprint("] ");
}
void printLine(const char *mod, const char *cs) {

View File

@ -1,7 +1,8 @@
#ifndef UTILS_H
#define UTILS_H
#include <stddef.h>
extern void kprint(const char *cs);
extern size_t kprint(const char *cs);
extern void kprintmod(const char *mod);
extern void printLine(const char *mod, const char *cs);
extern void printError(const char *mod, const char *cs);

Binary file not shown.