Files
zeekay 674da0bb9e Name the licence the repository actually carries
The headers said 'BSD3 License with Lux Industries Exceptions', which is not
a licence that exists — the sweep that removed the upstream vendor's name
substituted ours into the licence title instead of correcting it. LICENSE.txt
is the BSD 3-Clause Clear License and the headers now say so.
2026-08-27 16:00:52 -07:00

29 lines
973 B
C++

// Part of the Torus Compiler Project, under the BSD 3-Clause Clear
// License. See
// https://github.com/luxfhe/torus/blob/main/LICENSE.txt
// for license information.
#include <toruslang/Support/logging.h>
namespace mlir {
namespace toruslang {
static bool verbose = false;
static StreamWrap<llvm::raw_ostream> errWrap(&llvm::errs());
static StreamWrap<llvm::raw_ostream> nullWrap(&llvm::nulls());
/// Returns a stream for logging errors
StreamWrap<llvm::raw_ostream> &log_error(void) { return errWrap; }
/// Returns a stream that either shows or discards messages depending
/// on the setup through `setupLogging`.
StreamWrap<llvm::raw_ostream> &log_verbose(void) {
return (verbose) ? errWrap : nullWrap;
}
/// Sets up logging. If `verbose` is false, messages passed to
/// `log_verbose` will be discarded.
void setupLogging(bool verbose) { ::mlir::toruslang::verbose = verbose; }
bool isVerbose() { return verbose; }
} // namespace toruslang
} // namespace mlir