Пример #1
0
static Channel *createConsoleChannel()
{
#if defined(WIN32)
    if (coloredOutput) {
        Poco::WindowsColorConsoleChannel *c = new Poco::WindowsColorConsoleChannel();

        c->setProperty("traceColor", "gray");
        c->setProperty("debugColor", "brown");
        c->setProperty("informationColor", "green");
        c->setProperty("noticeColor", "blue");
        c->setProperty("warningColor", "yellow");
        c->setProperty("errorColor", "magenta");
        c->setProperty("criticalColor", "lightRed");
        c->setProperty("fatalColor", "red");

        return c;
    } else {
        return new Poco::WindowsConsoleChannel();
    }
#else
    if (coloredOutput) {
        Poco::ColorConsoleChannel *c = new Poco::ColorConsoleChannel();

        c->setProperty("traceColor", "gray");
        c->setProperty("debugColor", "brown");
        c->setProperty("informationColor", "green");
        c->setProperty("noticeColor", "blue");
        c->setProperty("warningColor", "yellow");
        c->setProperty("errorColor", "magenta");
        c->setProperty("criticalColor", "lightRed");
        c->setProperty("fatalColor", "red");

        return c;
    } else {
        return new Poco::ConsoleChannel();
    }
#endif
}
Пример #2
0
static Channel *createConsoleChannel()
{
#if defined(WIN32)
    if (consoleStream == &std::clog || consoleStream == &std::cout
            || consoleStream == &std::cerr) {
        // WIN32 system console mode
        if (coloredOutput) {
            // WIN32 color console output
            Poco::WindowsColorConsoleChannel *c =
                    new Poco::WindowsColorConsoleChannel();

            c->setProperty("traceColor", "gray");
            c->setProperty("debugColor", "brown");
            c->setProperty("informationColor", "green");
            c->setProperty("noticeColor", "blue");
            c->setProperty("warningColor", "lightMagenta");
            c->setProperty("errorColor", "magenta");
            c->setProperty("criticalColor", "lightRed");
            c->setProperty("fatalColor", "red");

            return c;
        } else {
            // WIN32 non-color console output
            return new Poco::ConsoleChannel(*consoleStream);
        }
    } else {
        // WIN32 python (or alternate stream) mode.
        if (coloredOutput) {
            // WIN32 Python color output
            Poco::ColorConsoleChannel *c =
                    new Poco::ColorConsoleChannel(*consoleStream);

            c->setProperty("traceColor", "gray");
            c->setProperty("debugColor", "brown");
            c->setProperty("informationColor", "green");
            c->setProperty("noticeColor", "blue");
            c->setProperty("warningColor", "lightMagenta");
            c->setProperty("errorColor", "magenta");
            c->setProperty("criticalColor", "lightRed");
            c->setProperty("fatalColor", "red");

            return c;

        } else {
            // WIN32 Python non-color output
            return new Poco::ConsoleChannel(*consoleStream);
        }
    }

#else
    if (coloredOutput) {
        Poco::ColorConsoleChannel *c =
                new Poco::ColorConsoleChannel(*consoleStream);


        c->setProperty("traceColor", "gray");
        c->setProperty("debugColor", "brown");
        c->setProperty("informationColor", "green");
        c->setProperty("noticeColor", "blue");
        c->setProperty("warningColor", "yellow");
        c->setProperty("errorColor", "magenta");
        c->setProperty("criticalColor", "lightRed");
        c->setProperty("fatalColor", "red");

        return c;
    } else {
        return new Poco::ConsoleChannel(*consoleStream);
    }
#endif
}