/*<html><pre>*/
#ifndef V_LOG_H
#define V_LOG_H

/*	Verbose levels.
 *	Note: conPuts() and conPrintf() ignore verbose level,
 *	which is meaningful only for conlPuts() and conlPrintf().
 */
#define		LOG_MUTE			0
#define		LOG_ERROR			0x10
#define		LOG_WARNING			0x20
#define		LOG_INFO			0x30
#define		LOG_TRACE			0x40

/*	This is a proto for caller-defined callback, which will be used
 *	to display messages.
 *	NOTE. In the current version of library can be defined not more
 *	then FOUR callbacks, including built-in callbacks for file and
 *	console logs. */
typedef	void	(V_CALL *con_puts_t)(char *str);

#ifdef	__cplusplus
extern "C" {
#endif	/* __cplusplus */
	/* format string */
	char_p		V_GLOBAL_VA	logFormatString(char *dest,const char *fmt,...);
	/*	Adds built-in or user-defined callback */
	vboolean	V_GLOBAL	logAddCallback(con_puts_t outcallback);
	/*	Removes callback */
	void		V_GLOBAL	logRemoveCallback(con_puts_t outcallback);
	/*	Sets level of filtering. Default level is LOG_ERROR, i.e.
		warnings, info and trace messages not displayed. Returns old
		level of filtering. */
	u32_t		V_GLOBAL	logUpperLevel(u32_t level);
	/*	This starts logging to file. NOTE: CR/LF after every string must
		be printed explicitly (different from std 'puts' function ) */
	vboolean	V_GLOBAL	logStartFileLog(char *name,vboolean flush_mode);
	/*	This stops logging to file. */
	void		V_GLOBAL	logStopFileLog(void);
	/*	This starts logging to stdout. See note for conOpeFileLog. */
	vboolean	V_GLOBAL	logStartConsoleLog(void);
	/*	This stops logging to stdout. */
	void		V_GLOBAL	logStopConsoleLog(void);
	/*	These print messages (using ALL callbacks) */
	void		V_GLOBAL	conPuts(char *str);
	void		V_GLOBAL_VA	conPrintf(const char *fmt, ...);
	/*	These are the same, but print message only if it level not greater
		then current level (which can be changed by 'conUpperLevel()') */
	void		V_GLOBAL	conlPuts(u32_t level,char *str);
	void		V_GLOBAL_VA	conlPrintf(u32_t level,const char *fmt, ...);
	/*	'prompt' can be NULL. return value is false if no chars entered */
	vboolean	V_GLOBAL	conGets(char *dest,u32_t dest_len,char *prompt);
	vboolean	V_GLOBAL	conGetInt(int *dest,char *prompt);
	vboolean	V_GLOBAL	conGetFloat(mvec_t *dest,char *prompt);
#ifdef	__cplusplus
}
#endif	/* __cplusplus */

#endif	/* V_LOG_H */

/*</pre></html>*/
/*EOF*/
