StreamChannel.cpp 626 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // StreamChannel.cpp
  3. //
  4. // $Id: //poco/1.4/Foundation/src/StreamChannel.cpp#1 $
  5. //
  6. // Library: Foundation
  7. // Package: Logging
  8. // Module: StreamChannel
  9. //
  10. // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
  11. // and Contributors.
  12. //
  13. // SPDX-License-Identifier: BSL-1.0
  14. //
  15. #include "Poco/StreamChannel.h"
  16. #include "Poco/Message.h"
  17. namespace Poco {
  18. StreamChannel::StreamChannel(std::ostream& str): _str(str)
  19. {
  20. }
  21. StreamChannel::~StreamChannel()
  22. {
  23. }
  24. void StreamChannel::log(const Message& msg)
  25. {
  26. FastMutex::ScopedLock lock(_mutex);
  27. _str << msg.getText() << std::endl;
  28. }
  29. } // namespace Poco