cling/lib/Utils/Output.cpp
Vassil Vassilev 2a956809bb Color handling moved from raw_fd_ostream to raw_ostream.
We do not need the wrapper which did more than needed.

See llvm/llvm-project@8744d7f25b
2022-12-09 08:44:16 +01:00

41 lines
1.1 KiB
C++

//------------------------------------------------------------------------------
// CLING - the C++ LLVM-based InterpreterG :)
// author:
//
// This file is dual-licensed: you can choose to license it under the University
// of Illinois Open Source License or the GNU Lesser General Public License. See
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
#include "cling/Utils/Output.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/raw_os_ostream.h"
#include <iostream>
namespace cling {
namespace utils {
llvm::raw_ostream& outs() {
static llvm::raw_os_ostream sOut(std::cout);
sOut.SetUnbuffered();
if (llvm::sys::Process::StandardOutIsDisplayed())
sOut.enable_colors(true);
return sOut;
}
llvm::raw_ostream& errs() {
static llvm::raw_os_ostream sErr(std::cerr);
sErr.SetUnbuffered();
if (llvm::sys::Process::StandardErrIsDisplayed())
sErr.enable_colors(true);
return sErr;
}
llvm::raw_ostream& log() {
return cling::errs();
}
}
}