Index: trunk/nv/core/logging.hh
===================================================================
--- trunk/nv/core/logging.hh	(revision 370)
+++ trunk/nv/core/logging.hh	(revision 371)
@@ -17,9 +17,4 @@
 #include <nv/stl/string.hh>
 #include <nv/stl/singleton.hh>
-#include <sstream>
-
-#include <nv/core/profiler.hh>
-
-
 
 namespace nv
@@ -72,13 +67,20 @@
 			m_pos += f32_to_buffer( f, m_pos );
 		}
-		void log( log_level level )
-		{
-			*m_pos = '\0';
-			log( level, string_ref( m_message, (size_t) ( m_pos - m_message ) ) );
-			m_pos = m_message;
-		}
 		static bool can_log( log_level level )
 		{
 			return logger_base::is_valid() && (unsigned int)reference().get_level() >= (unsigned int)level;
+		}
+
+		void log_sequence( log_level level )
+		{
+			*m_pos = '\0';
+			log( level, string_ref( m_message, (size_t)( m_pos - m_message ) ) );
+			m_pos = m_message;
+		}
+		template < typename T, typename... Args >
+		inline void log_sequence( log_level level, T&& t, Args&&... args )
+		{
+			log_append( t );
+			log_sequence( level, std::forward<Args>( args )... );
 		}
 		virtual ~logger_base() {}
@@ -89,52 +91,17 @@
 	};
 
-	namespace detail
-	{
-		inline void streamer( std::stringstream& )
-		{
-			// noop;
-		}
-
-		template < typename T, typename... Args >
-		inline void streamer( std::stringstream& ss, T&& t, Args&&... args )
-		{
-			ss << t;
-			streamer( ss, std::forward<Args>(args)... );
-		}
-		inline void logger( log_level level, logger_base& base )
-		{
-			base.log( level );
-		}
-
-		template < typename T, typename... Args >
-		inline void logger( log_level level, logger_base& base, T&& t, Args&&... args )
-		{
-			base.log_append( t );
-			logger( level, base, std::forward<Args>( args )... );
-		}
-	}
-
 } // namespace nv
-
-#define NV_LOG_STREAM(level, message_stream) \
-	if ( nv::logger_base::can_log(level) ) \
-	{       \
-		std::stringstream ss; \
-		ss << message_stream;\
-		nv::logger_base::reference().log( level, string_ref( ss.str() ) ); \
-	}
 
 #define NV_LOG(level, ...) \
 	if ( nv::logger_base::can_log(level) ) \
-										{       \
-		NV_PROFILE( "logging" );\
-		nv::detail::logger( level, nv::logger_base::reference(), __VA_ARGS__ ); \
-				}
+	{\
+		nv::logger_base::reference().log_sequence( level, __VA_ARGS__ ); \
+	}
 
 #if NV_DEBUG == 1
 #define NV_DEBUG_LOG(level, ...) \
 	if ( nv::logger_base::can_log(level) ) \
-	{       \
-		nv::detail::logger( level, nv::logger_base::reference(), __VA_ARGS__ ); \
+	{\
+		nv::logger_base::reference().log_sequence( level, __VA_ARGS__ ); \
 	}
 #else
Index: trunk/nv/core/profiler.hh
===================================================================
--- trunk/nv/core/profiler.hh	(revision 370)
+++ trunk/nv/core/profiler.hh	(revision 371)
@@ -16,4 +16,5 @@
 #include <nv/core/common.hh>
 #include <nv/stl/singleton.hh>
+#include <nv/stl/string.hh>
 #include <unordered_map>
 
@@ -40,6 +41,6 @@
 			}
 		protected:
-			node( const char* tag, node* parent );
-			node* request_child( const char* tag );
+			node( const string_ref& tag, node* parent );
+			node* request_child( const string_ref& tag );
 			void start();
 			bool stop();
@@ -62,5 +63,5 @@
 		~profiler();
 
-		void start_profile( const char* tag );
+		void start_profile( const string_ref& tag );
 		void stop_profile();
 	public:
@@ -69,5 +70,5 @@
 		void log_report();
 	private:
-		void log_node_children( const std::string& ind, const node* n );
+		void log_node_children( uint32 indent, const node* n );
 		node* m_root;
 		node* m_current;
@@ -77,5 +78,5 @@
 	{
 	public:
-		profiler_guard( const char* tag )
+		profiler_guard( string_ref tag )
 		{
 			profiler::pointer()->start_profile( tag );
Index: trunk/src/core/profiler.cc
===================================================================
--- trunk/src/core/profiler.cc	(revision 370)
+++ trunk/src/core/profiler.cc	(revision 371)
@@ -5,11 +5,14 @@
 #include "nv/core/profiler.hh"
 
-#include <iomanip>
-#include <ios>
 #include "nv/core/time.hh"
 #include "nv/core/logging.hh"
+#include <cstdio>
+#include <cstdlib>
 
 using namespace nv;
 
+#ifdef NV_MSVC
+#define snprintf sprintf_s
+#endif
 
 profiler::profiler()
@@ -25,5 +28,5 @@
 }
 
-void profiler::start_profile( const char* tag )
+void profiler::start_profile( const string_ref& tag )
 {
 	if ( tag != m_current->m_tag )
@@ -42,6 +45,6 @@
 }
 
-profiler::node::node( const char* tag, node* parent ) 
-	: m_tag( tag )
+profiler::node::node( const string_ref& tag, node* parent )
+	: m_tag( tag.to_string() )
 	, m_parent( parent )
 	, m_recusion( 0 )
@@ -53,7 +56,8 @@
 }
 
-profiler::node* profiler::node::request_child( const char* tag )
+profiler::node* profiler::node::request_child( const string_ref& tag )
 {
-	auto it = m_children.find( tag );
+	std::string stag( tag.to_string() );
+	auto it = m_children.find( stag );
 	if ( it != m_children.end() ) 
 		return it->second;
@@ -61,5 +65,5 @@
 	{
 		node* result = new node( tag, this );
-		m_children[ tag ] = result;
+		m_children[ stag ] = result;
 		return result;
 	}
@@ -101,17 +105,16 @@
 {
 	m_root->stop();
-	NV_LOG_INFO( "-- PROFILER REPORT -----------------------------------------" );
-	NV_LOG_STREAM( LOG_INFO, std::left << std::setw(24) << "TAG" 
-		<< std::setw(7) << "%PARNT" 
-		<< std::setw(7) << "CALLS" 
-		<< std::setw(10) << "TOTAL(ms)" 
-		<< std::setw(10) << "AVG(ms)" );
-	log_node_children( "", m_root );
-	NV_LOG_INFO( "-- PROFILER REPORT END -------------------------------------" );
+	NV_LOG_INFO( "-- PROFILER REPORT -------------------------------------" );
+	char buffer[128];
+	snprintf( buffer, 128, "%-23s %6s %6s %9s %6s", "TAG", "%PARNT", "CALLS", "TOTAL(ms)", "AVG(ms)" );
+	NV_LOG_INFO( string_ref( buffer, strlen(buffer) ) );
+ 	log_node_children( 0, m_root );
+	NV_LOG_INFO( "-- PROFILER REPORT END ---------------------------------" );
 	m_root->start();
 }
 
-void profiler::log_node_children( const std::string& ind, const node* n )
+void profiler::log_node_children( uint32 indent, const node* n )
 {
+	char buffer[128];
 	for ( const auto& pair : n->m_children )
 	{
@@ -119,13 +122,15 @@
 		if ( c->m_calls > 0 )
 		{
-			NV_LOG_STREAM( LOG_INFO, std::left << std::setw(24) << ind + c->m_tag 
-				<< std::setw(7) << std::setprecision(2) << std::fixed << ( (double)c->m_total_time_us / (double)c->m_parent->m_total_time_us ) * 100.0
-				<< std::setw(7) << c->m_calls 
-				<< std::setw(10) << std::setprecision(2) << std::fixed << c->m_total_time_us / 1000.f
-				<< std::setw(10) << std::setprecision(2) << std::fixed << ( (double)c->m_total_time_us / (double)c->m_calls ) / 1000.f
-				);
+			double pparent  = ( (double)c->m_total_time_us / (double)c->m_parent->m_total_time_us ) * 100.f;
+			int calls       = c->m_calls;
+			double total_ms = c->m_total_time_us / 1000.f;
+			double avg_ms   = ( (double)c->m_total_time_us / (double)c->m_calls ) / 1000.f;
+			if ( indent > 0 ) memset( buffer, '-', indent );
+			snprintf( buffer + indent, 128 - indent, "%*.*s %6.2f %6d %9.2f %6.2f", indent - 23, 23 - indent,
+				c->m_tag.c_str(), pparent, calls, total_ms, avg_ms );
+			NV_LOG_INFO( string_ref( buffer, strlen( buffer ) ) );
 			if ( c->m_children.size() > 0 )
 			{
-				log_node_children( ind + "-", c );
+				log_node_children( indent + 1, c );
 			}
 		}
