mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 17:16:50 +08:00
[rk_log]: add os_log function on window
separate os_log and platform log function git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@10 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
@@ -17,40 +17,30 @@
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include "rk_log.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <utils/Log.h>
|
||||
#endif
|
||||
|
||||
#include "os_log.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static RK_U32 mpp_log_flag = 0;
|
||||
static void (*rk_log_callback)(const char*, const char*, va_list) = os_log;
|
||||
static void (*rk_err_callback)(const char*, const char*, va_list) = os_err;
|
||||
|
||||
void rk_log(const char *fmt, ...)
|
||||
void _rk_log(const char *tag, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
#ifdef ANDROID
|
||||
ALOGI(fmt, args);
|
||||
#else
|
||||
vfprintf(stdout, fmt, args);
|
||||
#endif
|
||||
rk_log_callback(tag, fmt, args);
|
||||
va_end(args);
|
||||
return ;
|
||||
}
|
||||
|
||||
void rk_err(const char *fmt, ...)
|
||||
void _rk_err(const char *tag, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
#ifdef ANDROID
|
||||
ALOGE(fmt, args);
|
||||
#else
|
||||
vfprintf(stderr, fmt, args);
|
||||
#endif
|
||||
rk_err_callback(tag, fmt, args);
|
||||
va_end(args);
|
||||
return ;
|
||||
}
|
||||
|
Reference in New Issue
Block a user