2022-03-27 14:26:14 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include "printk.h"
|
|
|
|
|
2023-01-23 18:17:24 +00:00
|
|
|
void _printk(const char *file, const char *function, int line, const char *fmt, ...)
|
2022-03-27 14:26:14 +00:00
|
|
|
{
|
|
|
|
char buffer[4096], *b = buffer;
|
|
|
|
int s = sizeof(buffer) - 1;
|
|
|
|
int level = 1;
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
buffer[sizeof(buffer) - 1] = '\0';
|
|
|
|
|
|
|
|
/* remove debug level from format */
|
|
|
|
if (fmt[0] >= '0' && fmt[0] <= '9') {
|
|
|
|
level = fmt[0] - '0';
|
|
|
|
fmt++;
|
|
|
|
}
|
|
|
|
|
|
|
|
va_start(args, fmt);
|
|
|
|
vsnprintf(b, s, fmt, args);
|
|
|
|
va_end(args);
|
|
|
|
|
2023-01-23 18:17:24 +00:00
|
|
|
_printdebug(file, function, line, DMISDN, level, NULL, "%s", b);
|
2022-03-27 14:26:14 +00:00
|
|
|
}
|
|
|
|
|