view gen/logger.h @ 91:3f949c6e2e9d trunk

[svn r95] added support for mains like: T main(string[] args) fixed a bug with slicing a pointer that is an argument with no storage
author lindquist
date Wed, 07 Nov 2007 04:52:56 +0100
parents 27b2f40bdb58
children 61615fa85940
line wrap: on
line source

#ifndef _llvmd_gen_logger_h_
#define _llvmd_gen_logger_h_

#include <iostream>

namespace Logger
{
    void indent();
    void undent();
    std::ostream& cout();
    void println(const char* fmt, ...);
    void print(const char* fmt, ...);
    void enable();
    void disable();
    

    struct LoggerScope
    {
        LoggerScope()
        {
            Logger::indent();
            
        }
        ~LoggerScope()
        {
            Logger::undent();
        }
    };
}

#define LOG_SCOPE    Logger::LoggerScope _logscope;

#endif