diff -r 000000000000 -r 29b1cd4cb562 bluetooth/btexample/example/btsocket/inc/exbtutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bluetooth/btexample/example/btsocket/inc/exbtutil.h Fri Jan 15 08:13:17 2010 +0200 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Name : exbtutil.h +* Part of : ex_btsocket +* Created : 17/11/2004 by Shane Kearns +* Helper functions +* Version : +* +* +*/ + + + +#ifndef EXBTUTIL_H +#define EXBTUTIL_H + +#include + + +/** +A static utility class for debugging purposes +*/ +class ExBtSocket + { + public: + enum TExBtPanic + { + EBadCallback, + EReEntrant, + EUnsupportedProtocol + }; + static void Panic(TExBtPanic aPanic); + static void Log(const TRefByValue aFormat, ...); + }; + +#ifdef _DEBUG +#define ENABLE_LOG_INFO +#define ENABLE_LOG_FN_TRACE +#define ENABLE_LOG_ERROR +#define USE_FLOGGER +#endif + +#ifdef ENABLE_LOG_INFO +#ifdef USE_FLOGGER +#define LOG_INFO(X) ExBtSocket::Log X +#else +#define LOG_INFO(X) RDebug::Print X +#endif +#else +#define LOG_INFO(X) +#endif + +#ifdef ENABLE_LOG_ERROR +#ifdef USE_FLOGGER +#define LOG_ERROR(X) ExBtSocket::Log X +#else +#define LOG_ERROR(X) RDebug::Print X +#endif +#else +#define LOG_ERROR(X) +#endif + +#ifdef ENABLE_LOG_FN_TRACE +#ifdef USE_FLOGGER +#define LOG_FN_TRACE(X) ExBtSocket::Log X +#else +#define LOG_FN_TRACE(X) RDebug::Print X +#endif +#else +#define LOG_FN_TRACE(X) +#endif + +#endif // EXBTUTIL_H