#ifndef ka_log_h
#define ka_log_h

#include "inttypes.h"
#include <stdarg.h>

typedef enum
{ ka_log_rtc     = 0x000
, ka_log_simple  = 0x100
, ka_log_error   = 0x200
, ka_log_warning = 0x300
, ka_log_note    = 0x400
, ka_log_info    = 0x500
, ka_log_stats   = 0x600
} ka_log_category;

typedef enum
{ ka_log_none      = 0
, ka_log_buffer    = 1
, ka_log_video     = 2
, ka_log_audio     = 3
, ka_log_subtitle  = 4
, ka_log_demux     = 5
, ka_log_draw      = 6
, ka_log_seek      = 7
, ka_log_replay    = 8
, ka_log_nav       = 9
} ka_log_subcategory;

void ka_logReset(void);
void ka_allowStdOut(void);
#ifdef __CC_NORCROFT
#pragma -v1 // hint to the compiler to check f/s/printf format
#endif
void ka_log(int category, const char* pformat, ...);  // Log one line
void ka_logs(int category, const char* pformat, ...); // Start logging line
void ka_logn(const char* pformat, ...); // continue a started line
#ifdef __CC_NORCROFT
#pragma -v0 // return to default
#endif
void ka_logv(const char* pformat, va_list arg);
void ka_log_dump(const uint8_t* pdata, uint32_t size);

#endif
