Show
Ignore:
Timestamp:
09/13/09 23:14:26 (15 years ago)
Author:
smidl
Message:

new logger - stdlog - designed for easy debuggint in command line

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/base/loggers.h

    r565 r611  
    8989SHAREDPTR ( memlog ); 
    9090 
     91 
     92/*! \brief Simple logger used for debugging 
     93All data records are written out to std from where they could be send to file 
     94*/ 
     95class 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}; 
     138UIREGISTER(stdlog); 
     139 
    91140/*! 
    92141* \brief Logging into dirfile with buffer in memory