mirror of
				https://github.com/pocoproject/poco.git
				synced 2025-10-30 21:50:47 +01:00 
			
		
		
		
	Logger: added %O to message format to display numeric thread id in logs.
This commit is contained in:
		| @@ -29,6 +29,7 @@ namespace Poco { | ||||
| Message::Message():  | ||||
| 	_prio(PRIO_FATAL),  | ||||
| 	_tid(0),  | ||||
| 	_ostid(0),  | ||||
| 	_pid(0), | ||||
| 	_file(0), | ||||
| 	_line(0), | ||||
| @@ -43,6 +44,7 @@ Message::Message(const std::string& source, const std::string& text, Priority pr | ||||
| 	_text(text),  | ||||
| 	_prio(prio),  | ||||
| 	_tid(0), | ||||
| 	_ostid(0), | ||||
| 	_pid(0), | ||||
| 	_file(0), | ||||
| 	_line(0), | ||||
| @@ -57,6 +59,7 @@ Message::Message(const std::string& source, const std::string& text, Priority pr | ||||
| 	_text(text),  | ||||
| 	_prio(prio),  | ||||
| 	_tid(0), | ||||
| 	_ostid(0), | ||||
| 	_pid(0), | ||||
| 	_file(file), | ||||
| 	_line(line), | ||||
| @@ -72,6 +75,7 @@ Message::Message(const Message& msg): | ||||
| 	_prio(msg._prio), | ||||
| 	_time(msg._time), | ||||
| 	_tid(msg._tid), | ||||
| 	_ostid(msg._ostid), | ||||
| 	_thread(msg._thread), | ||||
| 	_pid(msg._pid), | ||||
| 	_file(msg._file), | ||||
| @@ -90,6 +94,7 @@ Message::Message(const Message& msg, const std::string& text): | ||||
| 	_prio(msg._prio), | ||||
| 	_time(msg._time), | ||||
| 	_tid(msg._tid), | ||||
| 	_ostid(msg._ostid), | ||||
| 	_thread(msg._thread), | ||||
| 	_pid(msg._pid), | ||||
| 	_file(msg._file), | ||||
| @@ -113,6 +118,7 @@ void Message::init() | ||||
| #if !defined(POCO_VXWORKS) | ||||
| 	_pid = Process::id(); | ||||
| #endif | ||||
| 	_ostid = Thread::currentTid(); | ||||
| 	Thread* pThread = Thread::current(); | ||||
| 	if (pThread) | ||||
| 	{ | ||||
|   | ||||
| @@ -75,6 +75,7 @@ void PatternFormatter::format(const Message& msg, std::string& text) | ||||
| 		case 'P': NumberFormatter::append(text, msg.getPid()); break; | ||||
| 		case 'T': text.append(msg.getThread()); break; | ||||
| 		case 'I': NumberFormatter::append(text, msg.getTid()); break; | ||||
| 		case 'O': NumberFormatter::append(text, msg.getOsTid()); break; | ||||
| 		case 'N': text.append(Environment::nodeName()); break; | ||||
| 		case 'U': text.append(msg.getSourceFile() ? msg.getSourceFile() : ""); break; | ||||
| 		case 'u': NumberFormatter::append(text, msg.getSourceLine()); break; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Matej Kenda
					Matej Kenda