b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | /****************************************************************************** |
| 2 | *(C) Copyright 2014 Marvell International Ltd. |
| 3 | * All Rights Reserved |
| 4 | ******************************************************************************/ |
| 5 | |
| 6 | #ifdef PXA1826_AUDIO |
| 7 | |
| 8 | #include <stdio.h> |
| 9 | #include <stdlib.h> |
| 10 | #include <stdio.h> |
| 11 | #include <stdlib.h> |
| 12 | #include <stdarg.h> |
| 13 | |
| 14 | #include "acm_log.h" |
| 15 | |
| 16 | int __acm_log_print(int prio, const char *tag, const char *fmt, ...) |
| 17 | { |
| 18 | va_list ap; |
| 19 | char buf[LOG_BUF_SIZE]; |
| 20 | int write_length; |
| 21 | (void)prio; |
| 22 | |
| 23 | write_length = snprintf(buf,LOG_BUF_SIZE,"%s: ",tag); |
| 24 | if ((write_length != 0) && (LOG_BUF_SIZE > write_length + 2)) { |
| 25 | va_start(ap, fmt); |
| 26 | write_length += vsnprintf(&buf[write_length], LOG_BUF_SIZE - write_length - 2, fmt, ap); |
| 27 | va_end(ap); |
| 28 | buf[write_length++] = '\n'; |
| 29 | buf[write_length++] = '\0'; |
| 30 | printf(buf); |
| 31 | } |
| 32 | |
| 33 | return write_length; |
| 34 | } |
| 35 | #endif//PXA1826_AUDIO |