/*
 * @(#)log.h
 */
#define	DEBUG_NONE	0	/* No extranious messages */
#define	DEBUG_STATE	1	/* Log major state changes */
#define	DEBUG_OP	2	/* Log significant operations */
#define	DEBUG_ACTIVE	3	/* Log low level activities */
#define	DEBUG_DETAIL	4	/* Log activity details */
#define	DEBUG_FUN	5	/* Log function calls */
#define	DEBUG_6		6	/* Log level 6 */
#define	DEBUG_7		7	/* Log level 7 */
#define	DEBUG_8		8	/* Log level 8 */
#define	DEBUG_ALL	9	/* Log every blessed thing we can think of */

/*
 * Log dump types.  OR'able values
 */
#define	LD_HEX		1	/* Type for LogDump--Hex dump */
#define	LD_ASCII	2	/* Type for LogDump--Ascii dump */

#define	debugout	stderr
#define	debugl(x)	((x)<=debugLevel)
#define dprintf(y,x)    {if(debugl((y))){LogPrefix(debugout);fprintf x;}}
#define dlogmsg(y,x)    {if(debugl((y))){LogMsg(x);}}

extern	int	debugLevel;		/* debug level */
extern	int	debugNetDump;		/* Dump network transactions */
extern	char	*logId;			/* Id string for log messages */
extern	char	logBuf[];		/* General purpose log buffer */

void	LogPrefix(FILE *);		/* output log message prefix */
void	LogMsg(char *);			/* log message */
void	LogError(char *);		/* log system error (perror())*/
void	LogDump(u_char *, int, int);	/* log hex dump */
