Commit 86933971 authored by Jonas Stienen's avatar Jonas Stienen
Browse files

Recatoring VALog and print outs

parent 2b88a692
......@@ -52,7 +52,7 @@ CVARealtimeLogger::CVARealtimeLogger()
SetThreadName( "VACore::RealtimeLogger" );
// Low thread priority
int iPriority = VistaPriority::VISTA_MIN_PRIORITY;
//int iPriority = VistaPriority::VISTA_MIN_PRIORITY;
//SetPriority(iPriority); // TODO stienen/wefers: klren wie man eine low priority setzen kann
Run();
......
......@@ -17,7 +17,7 @@
#include <iostream>
#include <list>
#include <stdarg.h>
#include <cstdarg>
extern VACORE_API std::ostream* VA_STDOUT;
extern VACORE_API std::ostream* VA_STDERR;
......@@ -103,38 +103,44 @@ private:
* niederpriorisiertem Thread auf die Konsole oder Visual Studio Ausgabe
* auszugeben.
*/
class CVARealtimeLogStream {
class CVARealtimeLogStream
{
public:
CVARealtimeLogStream( ITAClock* pClock = ITAClock::getDefaultClock() )
: m_pClock( pClock ) {
inline CVARealtimeLogStream( ITAClock* pClock = ITAClock::getDefaultClock() )
: m_pClock( pClock )
{
// Bei Ausgabe-Thread registrieren (Singleton)
CVARealtimeLogger::GetInstance()->Register( this );
}
};
virtual ~CVARealtimeLogStream() {
inline virtual ~CVARealtimeLogStream()
{
// Bei Thread deregistieren
CVARealtimeLogger::GetInstance()->Unregister( this );
}
};
std::string GetName() const {
inline std::string GetName() const
{
return m_sName;
}
};
void SetName( const std::string& sName ) {
inline void SetName( const std::string& sName )
{
m_sName = sName;
}
};
// Ausgabe
void Printf( const char * format, ... ) {
inline void Printf( const char * format, ... )
{
char buf[ 16384 ];
va_list args;
va_start( args, format );
vsprintf_s( buf, format, args );
vsprintf( buf, format, args );
va_end( args );
m_qLog.push( CVALogItem( m_pClock->getTime(), m_sName, buf ) );
// TODO: Thread zur Ausgabe anwerfen ggf.
}
};
private:
ITAClock* m_pClock;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment