root/experimental/NT-based/NTSpecific/AssertToNTLog.cpp

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. JMMCG_REVISION_CONSTANT
  2. assertlog

   1 /******************************************************************************
   2 ** $Header: svn+ssh://jmmcg@svn.code.sf.net/p/libjmmcg/code/trunk/libjmmcg/experimental/NT-based/NTSpecific/AssertToNTLog.cpp 2055 2017-05-13 19:35:47Z jmmcg $
   3 ** 
   4 ** Copyright (C) 2002 by J.M.McGuiness, coder@hussar.me.uk
   5 **
   6 ** This library is free software; you can redistribute it and/or
   7 ** modify it under the terms of the GNU Lesser General Public
   8 ** License as published by the Free Software Foundation; either
   9 ** version 2.1 of the License, or (at your option) any later version.
  10 **
  11 ** This library is distributed in the hope that it will be useful,
  12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14 ** Lesser General Public License for more details.
  15 **
  16 ** You should have received a copy of the GNU Lesser General Public
  17 ** License along with this library; if not, write to the Free Software
  18 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19 */
  20 
  21 #include "stdafx.h"
  22 
  23 #ifdef _DEBUG
  24 
  25 #       include "AssertToNTLog.hpp"
  26 #       include "EventLog.hpp"
  27 
  28 #include "../../../core/info.hpp"
  29 #include "../../../core/unicode_conversions.hpp"
  30 
  31 #       include <string>
  32 #       include <sstream>
  33 
  34 /////////////////////////////////////////////////////////////////////////////
  35 
  36 JMMCG_REVISION_CONSTANT(_T("$Header: svn+ssh://jmmcg@svn.code.sf.net/p/libjmmcg/code/trunk/libjmmcg/experimental/NT-based/NTSpecific/AssertToNTLog.cpp 2055 2017-05-13 19:35:47Z jmmcg $"))
  37 
  38 /////////////////////////////////////////////////////////////////////////////
  39 
  40 namespace {
  41         jmmcg::NTUtils::EventLog NTLog_D87A7F40_F129_11d4_B1AC_0001029FBE99_;
  42 }
  43 
  44 inline void __fastcall
  45 jmmcg::NTUtils::assertlog(const char *exp, const char *file_name, const unsigned long line) {
  46         tstringstream ss;
  47         ss<<_T("Debug assertion failed. File: '")<<jmmcg::StringToTString(file_name)
  48                 <<_T("'. Line: ")<<line
  49                 <<_T(". Process handle: 0x")<<::GetCurrentProcess()
  50                 <<_T(". Process ID: ")<<::GetCurrentProcessId()
  51                 <<_T(". Thread handle: 0x")<<::GetCurrentThread()
  52                 <<_T(". Thread ID: ")<<::GetCurrentThreadId()
  53                 <<_T(". Assertion: '")<<jmmcg::StringToTString(exp)<<_T("'.");
  54         NTLog_D87A7F40_F129_11d4_B1AC_0001029FBE99_.Log(jmmcg::NTUtils::EventLog::err_error, jmmcg::NTUtils::EventLog::cat_error, ss);
  55         exit(255);
  56 }
  57 
  58 #endif _DEBUG

/* [<][>][^][v][top][bottom][index][help] */