X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSALOMELocalTrace%2Futilities.h;h=dbfa0d34b6626073ad94eff44caa951273e1d3d8;hb=82668fe5e4d077072402d253497f96d4c53391f9;hp=28696612bdf078508c8c8960eba9a7006c525632;hpb=89d8cdd476c5f4d65bc3fd1089f092af42e2841c;p=modules%2Fkernel.git diff --git a/src/SALOMELocalTrace/utilities.h b/src/SALOMELocalTrace/utilities.h index 28696612b..dbfa0d34b 100644 --- a/src/SALOMELocalTrace/utilities.h +++ b/src/SALOMELocalTrace/utilities.h @@ -1,37 +1,36 @@ -// SALOME Utils : general SALOME's definitions and tools +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// SALOME Utils : general SALOME's definitions and tools // File : utilities.h // Author : Antoine YESSAYAN, Paul RASCLE, EDF // Module : SALOME // $Header$ - -/* --- Definition macros file to print informations if _DEBUG_ is defined --- */ +// +/* --- Definition macros file to print information if _DEBUG_ is defined --- */ #ifndef UTILITIES_H #define UTILITIES_H -#include #include #include #include @@ -48,51 +47,65 @@ * This buffer is read later by a specific thread in charge of trace print. * Order of trace entries is globally respected. Nevertheless, if there are * several threads waiting for a free buffer to trace, the order of - * thread waken up is not garanteed (no fifo or priority rules in Linux Kernel) + * thread waken up is not guaranteed (no fifo or priority rules in Linux Kernel) */ #define MESS_INIT(deb) std::ostringstream os; os<insert(NORMAL_MESS, os.str().c_str()); -#define MESS_ABORT endl; LocalTraceBufferPool::instance()->insert(ABORT_MESS, os.str().c_str()); +#define MESS_END std::endl; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, os.str().c_str()); +#define MESS_ABORT std::endl; LocalTraceBufferPool::instance()->insert(ABORT_MESS, os.str().c_str()); + +// Macroses for messages with separated structure in c++ file in _DUBUG mode +#define MESSAGE_BEGIN(msg) {std::ostringstream ss; ss <<__FILE__ <<" ["<<__LINE__<<"] : "<< msg; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, ss.str().c_str());} +#define MESSAGE_ADD(msg) {std::ostringstream ss; ss << msg; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, ss.str().c_str());} +#define MESSAGE_END(msg) {std::ostringstream ss; ss << msg << std::endl; LocalTraceBufferPool::instance()->insert(NORMAL_MESS, ss.str().c_str());} // --- Some macros are always defined (without _DEBUG_): for use with release version #define INFOS(msg) {MESS_BEGIN("- Trace ") << msg << MESS_END} #define PYSCRIPT(msg) {MESS_INIT("---PYSCRIPT--- ") << msg << MESS_END} #define INTERRUPTION(msg) {MESS_BEGIN("- INTERRUPTION: ")<< msg << MESS_ABORT} -#define IMMEDIATE_ABORT(code) {cout <