28 lines
529 B
C
28 lines
529 B
C
|
|
#include <stdio.h>
|
|
#include <stdarg.h>
|
|
#include "printk.h"
|
|
|
|
void _printk(const char *file, const char *function, int line, const char *fmt, ...)
|
|
{
|
|
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);
|
|
|
|
_printdebug(file, function, line, DMISDN, level, NULL, "%s", b);
|
|
}
|
|
|