Overview
Examples
Screenshots
Comparisons
Applications
Download
Manual
Status & Roadmap
FAQ
Authors & License
Forums
Wiki
Funding Ultimate++
Search on this site









SourceForge.net Logo



Log

 

Using diagnostic logs

This example shows basic capabilities of U++ logging subsystem, invaluable debugging tool. Output is stored in the file with .log extension in executable directory (or home dir on Linux):

 

# This is the LogFile of executable e:outuppsrcT_LogGNU-BLITZ-CONSOLE-DEBUG-DEBUG_FULL-GCC-MAIN-ST-WIN32T_Log.exe created 25.01.2004 16:07:42, part #1

123

Loop:

    i = 0

    i = 1

    i = 2

    i = 3

Foo(1) = Foo: 1

x:

    [0] = One

    [1] = Two

    [2] = Three

Memory at 0x453010, size 0xC8 = 200

   +0 0x00453010 61 6C 73 6A 6B 64 66 68 6C 61 6B 73 6A 64 68 66     alsjkdfhlaksjdhf

  +16 0x00453020 6B 6C 61 6A 73 68 64 66 6B 6C 6A 00 00 00 00 00     klajshdfklj.....

  +32 0x00453030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................

  +48 0x00453040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................

  +64 0x00453050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................

  +80 0x00453060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................

  +96 0x00453070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................

 +112 0x00453080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................

 +128 0x00453090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................

 +144 0x004530A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................

 +160 0x004530B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................

 +176 0x004530C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00     ................

 +192 0x004530D0 00 00 00 00 00 00 00 00                             ........        

This will appear even in the release mode

 

 

 

log.cpp

 

#include <Core/Core.h>

 

using namespace Upp;

 

struct Foo {

    int i;

 

    String ToString() const { return "Foo: " + AsString(i); }

 

    Foo() { i = 0; }

    Foo(int i) : i(i) {}

};

 

CONSOLE_APP_MAIN

{

    LOG(123);

    LOG("Loop:");

    LOGBEGIN();

    for(int i = 0; i < 4; i++)

        DUMP(i);

    LOGEND();

    DUMP(Foo(1));

    Vector<String> x;

    x.Add("One");

    x.Add("Two");

    x.Add("Three");

    DUMPC(x);

    static char h[200] = "alsjkdfhlaksjdhfklajshdfklj";

    LOGHEXDUMP(h, 200);

    RLOG("This will appear even in the release mode");

}