YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
LogComponent.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
7
9
10#include <atomic>
11#include <cstring>
12#include <cstdlib>
13
14namespace {
15
16std::atomic<bool> quiet(yarp::conf::environment::get_bool("YARP_QUIET", false));
17std::atomic<bool> verbose(yarp::conf::environment::get_bool("YARP_VERBOSE", false) && !quiet.load());
18
19std::atomic<yarp::os::Log::LogType> minimumOsPrintLevel(
20 (quiet.load() ? yarp::os::Log::WarningType :
21 (verbose.load() ? yarp::os::Log::DebugType : yarp::os::Log::InfoType)));
22
23} // namespace
24
29
A mini-server for performing network communication in the background.
@ WarningType
Definition Log.h:95
bool get_bool(const std::string &key, bool defaultValue=false)
Read a bool value from an environment variable.
yarp::os::Log::LogType minimumLogType()
void setMinumumLogType(yarp::os::Log::LogType minumumLogType)
The main, catch-all namespace for YARP.
Definition dirs.h:16