| 91 | |
| 92 | /*! \brief Simple logger used for debugging |
| 93 | All data records are written out to std from where they could be send to file |
| 94 | */ |
| 95 | class stdlog: public memlog{ |
| 96 | public: |
| 97 | //! default constructor |
| 98 | stdlog():memlog(1){}; |
| 99 | |
| 100 | void init() { |
| 101 | memlog::init(); |
| 102 | for (int i=0; i<entries.length();i++){ |
| 103 | if (entries(i)._dsize()==1) { |
| 104 | cout << names(i) << entries(i).name(0) << "\t"; |
| 105 | } |
| 106 | else |
| 107 | for (int j=0; j<vectors(i).cols(); j++){ |
| 108 | cout << names(i) << entries(i).scalarname(j) << "\t"; |
| 109 | } |
| 110 | } |
| 111 | cout << endl; |
| 112 | |
| 113 | |
| 114 | } |
| 115 | //!writes everything out |
| 116 | void step() { |
| 117 | for (int i=0; i<vectors.length();i++){ |
| 118 | for (int j=0; j<vectors(i).cols(); j++){ |
| 119 | cout << vectors(i)(0,j) << "\t"; |
| 120 | } |
| 121 | } |
| 122 | cout << endl; |
| 123 | } |
| 124 | /*! \brief UI for stdlog |
| 125 | |
| 126 | TODO dat tam kam patri, a to celej blok |
| 127 | |
| 128 | \code |
| 129 | logger = { |
| 130 | class = "stdlog"; // no parameterization needed |
| 131 | } |
| 132 | \endcode |
| 133 | */ |
| 134 | void from_setting ( const Setting &set ){ |
| 135 | } |
| 136 | |
| 137 | }; |
| 138 | UIREGISTER(stdlog); |
| 139 | |