Author: sh-sh-sh
Date: Thu Jan 17 14:09:11 2008
New Revision: 43715
URL: http://svn.opensuse.org/viewcvs/yast?rev=43715&view=rev
Log:
use YUI stream logging
Modified:
trunk/core/libyui/src/YUIException.cc
trunk/core/libyui/src/YUIException.h
trunk/core/libyui/src/YUILog.cc
Modified: trunk/core/libyui/src/YUIException.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YUIException.cc?rev=43715&r1=43714&r2=43715&view=diff
==============================================================================
--- trunk/core/libyui/src/YUIException.cc (original)
+++ trunk/core/libyui/src/YUIException.cc Thu Jan 17 14:09:11 2008
@@ -22,8 +22,8 @@
#include <sstream>
#include // strerror()
-#define y2log_component "ui"
-#include
+#define YUILogComponent "ui"
+#include "YUILog.h"
#include "YUIException.h"
#include "YWidget.h"
@@ -46,6 +46,7 @@
return str;
}
+
ostream &
operator<<( ostream & str, const YCodeLocation & obj )
{
@@ -53,7 +54,6 @@
}
-
YUIException::YUIException()
{
// NOP
@@ -123,11 +123,11 @@
const YCodeLocation & location,
const char * const prefix )
{
- y2warning( "%s %s %s",
- location.asString().c_str(),
- prefix,
- exception.asString().c_str() );
- // INT << where_r << " " << prefix_r << " " << excpt_r << endl;
+ YUILog::warning( YUILogComponent,
+ location.file().c_str(),
+ location.line(),
+ location.func().c_str() )
+ << "\t" << prefix << " " << exception.asString() << endl;
}
Modified: trunk/core/libyui/src/YUIException.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YUIException.h?rev=43715&r1=43714&r2=43715&view=diff
==============================================================================
--- trunk/core/libyui/src/YUIException.h (original)
+++ trunk/core/libyui/src/YUIException.h Thu Jan 17 14:09:11 2008
@@ -216,7 +216,7 @@
**/
YCodeLocation( const string & file_r,
const string & func_r,
- unsigned line_r )
+ int line_r )
: _file( file_r )
, _func( func_r )
, _line( line_r )
@@ -242,7 +242,7 @@
/**
* Returns the source line number where the exception occured.
**/
- unsigned line() const { return _line; }
+ int line() const { return _line; }
/**
* Returns the location in normalized string format.
@@ -257,7 +257,7 @@
private:
string _file;
string _func;
- unsigned _line;
+ int _line;
}; // YCodeLocation
Modified: trunk/core/libyui/src/YUILog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YUILog.cc?rev=43715&r1=43714&r2=43715&view=diff
==============================================================================
--- trunk/core/libyui/src/YUILog.cc (original)
+++ trunk/core/libyui/src/YUILog.cc Thu Jan 17 14:09:11 2008
@@ -17,10 +17,11 @@
/-*/
+#include
+
#define YUILogComponent "ui"
#include "YUILog.h"
#include "YUIException.h"
-#include
using std::ostream;
using std::cerr;
@@ -120,14 +121,14 @@
if ( logLevel != YUI_LOG_DEBUG || enableDebugLogging )
{
// Add new character sequence
-
+
if ( seqLen > 0 )
buffer += string( sequence, seqLen );
//
// Output buffer contents line by line
//
-
+
std::size_t start = 0;
std::size_t newline_pos = 0;
@@ -168,7 +169,7 @@
char sequence = ch;
writeBuffer( &sequence, 1 );
}
-
+
return 0;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org