ORCA: Optimization-based framework for Robotic Control Applications
Logger.h
Go to the documentation of this file.
1 //| This file is a part of the ORCA framework.
2 //|
3 //| Copyright 2018, Fuzzy Logic Robotics
4 //| Copyright 2017, ISIR / Universite Pierre et Marie Curie (UPMC)
5 //|
6 //| Main contributor(s): Antoine Hoarau, Ryan Lober, and
7 //| Fuzzy Logic Robotics <info@fuzzylogicrobotics.com>
8 //|
9 //| ORCA is a whole-body reactive controller framework for robotics.
10 //|
11 //| This software is governed by the CeCILL-C license under French law and
12 //| abiding by the rules of distribution of free software. You can use,
13 //| modify and/ or redistribute the software under the terms of the CeCILL-C
14 //| license as circulated by CEA, CNRS and INRIA at the following URL
15 //| "http://www.cecill.info".
16 //|
17 //| As a counterpart to the access to the source code and rights to copy,
18 //| modify and redistribute granted by the license, users are provided only
19 //| with a limited warranty and the software's author, the holder of the
20 //| economic rights, and the successive licensors have only limited
21 //| liability.
22 //|
23 //| In this respect, the user's attention is drawn to the risks associated
24 //| with loading, using, modifying and/or developing or reproducing the
25 //| software by the user in light of its specific status of free software,
26 //| that may mean that it is complicated to manipulate, and that also
27 //| therefore means that it is reserved for developers and experienced
28 //| professionals having in-depth computer knowledge. Users are therefore
29 //| encouraged to load and test the software's suitability as regards their
30 //| requirements in conditions enabling the security of their systems and/or
31 //| data to be ensured and, more generally, to use and operate it in the
32 //| same conditions as regards security.
33 //|
34 //| The fact that you are presently reading this means that you have had
35 //| knowledge of the CeCILL-C license and that you accept its terms.
36 
37 #pragma once
38 #include <plog/Log.h>
39 
40 namespace orca
41 {
42 namespace utils
43 {
44 
45  enum class LogLevel
46  {
47  none = 0,
48  fatal = 1,
49  error = 2,
50  warning = 3,
51  info = 4,
52  debug = 5,
53  verbose = 6
54  };
55 
56  struct Logger
57  {
58  Logger();
59  virtual ~Logger() {}
60  static void setLogLevel(LogLevel log_level);
61  static void setLogLevel(int log_level);
62  static void setLogLevel(const std::string& log_level);
63  static void parseArgv(int argc,char ** argv);
64  static void parseArgv(const std::vector<std::string>& v);
65  static void parseArgv(int argc,char const* argv[]);
66  };
67 } // namespace utils
68 } // namespace orca
69 
70 #include <Eigen/Dense>
71 #include <sstream>
72 namespace plog
73 {
74  template <typename Derived>
75  Record& operator<<(Record& record, const Eigen::MatrixBase<Derived>& a)
76  {
77  std::stringstream ss;
78  ss << a;
79  return record << ss.str();
80  }
81  template <typename Derived>
82  Record& operator<<(Record& record, const Eigen::Transpose<const Derived>& a)
83  {
84  std::stringstream ss;
85  ss << a;
86  return record << ss.str();
87  }
88 }
Definition: Logger.h:72
virtual ~Logger()
Definition: Logger.h:59
Definition: Logger.h:56
LogLevel
Definition: Logger.h:45
Definition: CartesianAccelerationPID.h:44