integrated latest changes from main repository

This commit is contained in:
Guenter Obiltschnig 2007-05-01 09:35:46 +00:00
parent a18bc8939f
commit 0fc23174be
5 changed files with 108 additions and 11 deletions

View File

@ -1,7 +1,7 @@
//
// LogStream.h
//
// $Id: //poco/Main/Foundation/include/Poco/LogStream.h#2 $
// $Id: //poco/Main/Foundation/include/Poco/LogStream.h#3 $
//
// Library: Foundation
// Package: Logging
@ -9,7 +9,7 @@
//
// Definition of the LogStream class.
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// Copyright (c) 2006-2007, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
@ -71,6 +71,9 @@ public:
Message::Priority getPriority() const;
/// Returns the priority for log messages.
Logger& logger() const;
/// Returns a reference to the Logger.
private:
int writeToDevice(char c);
@ -125,27 +128,59 @@ public:
LogStream& fatal();
/// Sets the priority for log messages to Message::PRIO_FATAL.
LogStream& fatal(const std::string& message);
/// Sets the priority for log messages to Message::PRIO_FATAL
/// and writes the given message.
LogStream& critical();
/// Sets the priority for log messages to Message::PRIO_CRITICAL.
LogStream& critical(const std::string& message);
/// Sets the priority for log messages to Message::PRIO_CRITICAL
/// and writes the given message.
LogStream& error();
/// Sets the priority for log messages to Message::PRIO_ERROR.
LogStream& error(const std::string& message);
/// Sets the priority for log messages to Message::PRIO_ERROR
/// and writes the given message.
LogStream& warning();
/// Sets the priority for log messages to Message::PRIO_WARNING.
LogStream& warning(const std::string& message);
/// Sets the priority for log messages to Message::PRIO_WARNING
/// and writes the given message.
LogStream& notice();
/// Sets the priority for log messages to Message::PRIO_NOTICE.
LogStream& notice(const std::string& message);
/// Sets the priority for log messages to Message::PRIO_NOTICE
/// and writes the given message.
LogStream& information();
/// Sets the priority for log messages to Message::PRIO_INFORMATION.
LogStream& information(const std::string& message);
/// Sets the priority for log messages to Message::PRIO_INFORMATION
/// and writes the given message.
LogStream& debug();
/// Sets the priority for log messages to Message::PRIO_DEBUG.
LogStream& debug(const std::string& message);
/// Sets the priority for log messages to Message::PRIO_DEBUG
/// and writes the given message.
LogStream& trace();
/// Sets the priority for log messages to Message::PRIO_TRACE.
LogStream& trace(const std::string& message);
/// Sets the priority for log messages to Message::PRIO_TRACE
/// and writes the given message.
LogStream& priority(Message::Priority priority);
/// Sets the priority for log messages.
};
@ -160,6 +195,12 @@ inline Message::Priority LogStreamBuf::getPriority() const
}
inline Logger& LogStreamBuf::logger() const
{
return _logger;
}
} // namespace Poco

View File

@ -1,13 +1,13 @@
//
// LogStream.cpp
//
// $Id: //poco/Main/Foundation/src/LogStream.cpp#3 $
// $Id: //poco/Main/Foundation/src/LogStream.cpp#4 $
//
// Library: Foundation
// Package: Logging
// Module: LogStream
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// Copyright (c) 2006-2007, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
@ -128,6 +128,13 @@ LogStream& LogStream::fatal()
return priority(Message::PRIO_FATAL);
}
LogStream& LogStream::fatal(const std::string& message)
{
_buf.logger().fatal(message);
return priority(Message::PRIO_FATAL);
}
LogStream& LogStream::critical()
{
@ -135,42 +142,91 @@ LogStream& LogStream::critical()
}
LogStream& LogStream::critical(const std::string& message)
{
_buf.logger().critical(message);
return priority(Message::PRIO_CRITICAL);
}
LogStream& LogStream::error()
{
return priority(Message::PRIO_ERROR);
}
LogStream& LogStream::error(const std::string& message)
{
_buf.logger().error(message);
return priority(Message::PRIO_ERROR);
}
LogStream& LogStream::warning()
{
return priority(Message::PRIO_WARNING);
}
LogStream& LogStream::warning(const std::string& message)
{
_buf.logger().warning(message);
return priority(Message::PRIO_WARNING);
}
LogStream& LogStream::notice()
{
return priority(Message::PRIO_NOTICE);
}
LogStream& LogStream::notice(const std::string& message)
{
_buf.logger().notice(message);
return priority(Message::PRIO_NOTICE);
}
LogStream& LogStream::information()
{
return priority(Message::PRIO_INFORMATION);
}
LogStream& LogStream::information(const std::string& message)
{
_buf.logger().information(message);
return priority(Message::PRIO_INFORMATION);
}
LogStream& LogStream::debug()
{
return priority(Message::PRIO_DEBUG);
}
LogStream& LogStream::debug(const std::string& message)
{
_buf.logger().debug(message);
return priority(Message::PRIO_DEBUG);
}
LogStream& LogStream::trace()
{
return priority(Message::PRIO_TRACE);
}
LogStream& LogStream::trace(const std::string& message)
{
_buf.logger().trace(message);
return priority(Message::PRIO_TRACE);
}
LogStream& LogStream::priority(Message::Priority priority)
{
_buf.setPriority(priority);

View File

@ -1,7 +1,7 @@
//
// HTTPServerRequest.h
//
// $Id: //poco/Main/Net/include/Poco/Net/HTTPServerRequest.h#5 $
// $Id: //poco/Main/Net/include/Poco/Net/HTTPServerRequest.h#6 $
//
// Library: Net
// Package: HTTPServer
@ -56,7 +56,7 @@ class HTTPServerParams;
class Net_API HTTPServerRequest: public HTTPRequest
/// This abstract HTTPServerRequest of HTTPRequest is used for
/// This abstract subclass of HTTPRequest is used for
/// representing server-side HTTP requests.
///
/// A HTTPServerRequest is passed to the

View File

@ -1,7 +1,7 @@
//
// ICMPv4PacketImpl.h
//
// $Id: //poco/Main/Net/include/Poco/Net/ICMPv4PacketImpl.h#2 $
// $Id: //poco/Main/Net/include/Poco/Net/ICMPv4PacketImpl.h#3 $
//
// Library: Net
// Package: ICMP
@ -77,12 +77,12 @@ public:
REDIRECT,
ICMP_6,
ICMP_7,
ECHO,
ECHO_REQUEST,
ICMP_9,
ICMP_10,
TIME_EXCEEDED,
PARAMETER_PROBLEM,
TIMESTAMP,
TIMESTAMP_REQUEST,
TIMESTAMP_REPLY,
INFORMATION_REQUEST,
INFORMATION_REPLY,

View File

@ -1,7 +1,7 @@
//
// ICMPv4PacketImpl.cpp
//
// $Id: //poco/Main/Net/src/ICMPv4PacketImpl.cpp#4 $
// $Id: //poco/Main/Net/src/ICMPv4PacketImpl.cpp#5 $
//
// Library: Net
// Package: ICMP
@ -147,7 +147,7 @@ void ICMPv4PacketImpl::initPacket()
if (_seq >= MAX_SEQ_VALUE) resetSequence();
Header* icp = (Header*) packet(false);
icp->type = ECHO;
icp->type = ECHO_REQUEST;
icp->code = 0;
icp->checksum = 0;
icp->seq = ++_seq;