home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / YellowBox / Kits / MiscTableScroll-138.1 / Palettes / MiscTableScroll / Framework / MiscTracer.cc < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-31  |  2.0 KB  |  54 lines

  1. //=============================================================================
  2. //
  3. //    Copyright (C) 1997,1998 by Paul S. McCarthy and Eric Sunshine.
  4. //        Written by Paul S. McCarthy and Eric Sunshine.
  5. //                All Rights Reserved.
  6. //
  7. //    This notice may not be removed from this source code.
  8. //
  9. //    This object is included in the MiscKit by permission from the authors
  10. //    and its use is governed by the MiscKit license, found in the file
  11. //    "License.rtf" in the MiscKit distribution.  Please refer to that file
  12. //    for a list of all applicable permissions and restrictions.
  13. //    
  14. //=============================================================================
  15. //-----------------------------------------------------------------------------
  16. // MiscTracer.h
  17. //
  18. //    Simple C++ class that helps generate function enter/exit
  19. //    trace messages.
  20. //
  21. //-----------------------------------------------------------------------------
  22. //-----------------------------------------------------------------------------
  23. // $Id: MiscTracer.cc,v 1.2 98/03/23 07:48:25 sunshine Exp $
  24. // $Log:    MiscTracer.cc,v $
  25. //  Revision 1.2  98/03/23  07:48:25  sunshine
  26. //  v134.1: Ported from NEXTSTEP to OPENSTEP/Rhapsody.
  27. //  
  28. //  Revision 1.1  97/12/22  22:00:33  zarnuk
  29. //  v134: Utility class to create function enter/exit messages.
  30. //-----------------------------------------------------------------------------
  31. #ifdef __GNUC__
  32. #pragma implementation
  33. #endif
  34. #include "MiscTracer.h"
  35. extern "Objective-C" {
  36. #include <Foundation/NSAutoreleasePool.h>
  37. #include <Foundation/NSUtilities.h>
  38. }
  39.  
  40. int MiscTracer::TRACE_DEPTH = 0;
  41.  
  42. //-----------------------------------------------------------------------------
  43. // dump
  44. //-----------------------------------------------------------------------------
  45. void MiscTracer::dump( char const* s ) const
  46.     {
  47.     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
  48.     NSMutableString* pad = [NSMutableString string];
  49.     for (int i = 0; i < TRACE_DEPTH; i++)
  50.     [pad appendString:@" "];
  51.     NSLog( @"%@%s %s", pad, s, msg );
  52.     [pool release];
  53.     }
  54.