view gen/logger.h @ 841:783f67fbdf4a

Removed insufficient fix for DMD bug 1161, it was causing problems with instantiating imported templates, and passing private variables as aliases. I failed to come up with a proper fix!
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Wed, 10 Dec 2008 13:56:10 +0100
parents 1700239cab2e
children 18ad5601dff7
line wrap: on
line source

#ifndef _llvmd_gen_logger_h_
#define _llvmd_gen_logger_h_

#include <iostream>

struct Loc;

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

    void attention(const Loc& loc, const char* fmt, ...);

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

#define LOG_SCOPE    Logger::LoggerScope _logscope;

#endif