Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 30, 2009, 12:39:51 PM (15 years ago)
Author:
rgrieder
Message:

De-singletonised Shell so that both consoles have their own Shell instance. However they share the history.
Also modified IOConsole to hopefully work with status lines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/libraries/util/OutputHandler.h

    r5996 r6004  
    142142            //! Returns the soft debug level for a device by its name   @return The level or -1 if the listener was not found
    143143            int  getSoftDebugLevel(const std::string& name) const;
    144             //! Sets the soft debug level for a listener by its name
     144            //! Sets the soft debug level for a listener by its name   @remarks Only works for registered listeners!
    145145            void setSoftDebugLevel(const std::string& name, int level);
    146146
     
    231231            : outputStream_(NULL)
    232232            , name_(name)
     233            , softDebugLevel_(OutputLevel::Info)
    233234        {}
    234235        virtual ~OutputListener() {}
    235236
    236237        //! Gets called whenever output is put into the stream
    237         virtual void outputChanged() {}
     238        virtual void outputChanged(int level) {}
    238239        //! Returns the name of this output listener
    239240        const std::string& getOutputListenerName() const { return this->name_; }
     241        //! Returns the soft debug level of the listener
     242        int getSoftDebugLevel() const { return this->softDebugLevel_; }
     243        //! Sets the soft debug level of the listener
     244        void setSoftDebugLevel(int level)
     245        {
     246            this->softDebugLevel_ = level;
     247            OutputHandler::getInstance().setSoftDebugLevel(this->name_, level);
     248        }
    240249
    241250    protected:
     
    257266                stream << output;
    258267                stream.flush();
    259                 (*it)->outputChanged();
     268                (*it)->outputChanged(this->outputLevel_);
    260269            }
    261270        }
Note: See TracChangeset for help on using the changeset viewer.