2005-05-23 22:47:42 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2005 by Daniel Stenberg
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2005-05-23 22:47:42 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef LOGF_H
|
|
|
|
#define LOGF_H
|
2005-05-30 13:00:43 +00:00
|
|
|
#include <config.h>
|
2005-06-22 14:46:38 +00:00
|
|
|
#include <stdbool.h>
|
2007-03-17 09:54:28 +00:00
|
|
|
#include "../include/_ansi.h"
|
2007-10-24 22:06:36 +00:00
|
|
|
#include "debug.h"
|
2005-05-30 13:00:43 +00:00
|
|
|
|
|
|
|
#ifdef ROCKBOX_HAS_LOGF
|
2005-05-23 22:47:42 +00:00
|
|
|
|
2006-11-10 08:03:33 +00:00
|
|
|
#ifndef __PCTOOL__
|
2005-05-24 14:27:17 +00:00
|
|
|
|
2009-08-21 22:54:23 +00:00
|
|
|
#define MAX_LOGF_SIZE 16384
|
2008-12-31 17:01:00 +00:00
|
|
|
|
2009-08-21 22:54:23 +00:00
|
|
|
extern unsigned char logfbuffer[MAX_LOGF_SIZE];
|
2005-05-24 14:27:17 +00:00
|
|
|
extern int logfindex;
|
2005-05-23 22:47:42 +00:00
|
|
|
extern bool logfwrap;
|
2006-11-10 08:03:33 +00:00
|
|
|
#endif /* __PCTOOL__ */
|
2005-05-23 22:47:42 +00:00
|
|
|
|
2006-11-10 08:03:33 +00:00
|
|
|
#define logf _logf
|
2007-03-17 09:02:53 +00:00
|
|
|
void _logf(const char *format, ...) ATTRIBUTE_PRINTF(1, 2);
|
2006-11-10 08:03:33 +00:00
|
|
|
|
|
|
|
#else /* !ROCKBOX_HAS_LOGF */
|
2007-10-24 22:06:36 +00:00
|
|
|
|
|
|
|
/* built without logf() support enabled, replace logf() by DEBUGF() */
|
|
|
|
#define logf(f,args...) DEBUGF(f"\n",##args)
|
|
|
|
|
2006-11-10 08:03:33 +00:00
|
|
|
#endif /* !ROCKBOX_HAS_LOGF */
|
2005-05-23 22:47:42 +00:00
|
|
|
|
|
|
|
#endif /* LOGF_H */
|
2007-10-24 22:06:36 +00:00
|
|
|
|
|
|
|
/* Allow fine tuning (per file) of the logf output */
|
|
|
|
#ifndef LOGF_ENABLE
|
|
|
|
#undef logf
|
|
|
|
#define logf(...)
|
|
|
|
#endif
|