diff options
author | Jose <jose@zeroc.com> | 2014-05-07 00:42:20 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2014-05-07 00:42:20 +0200 |
commit | fa7430226acd87c37ac70e686fbc6038707e0d11 (patch) | |
tree | 4c1f3e81d5438f62a793247320a0b6a7d67a6e6d /cpp/test/Ice/logger/Client4.cpp | |
parent | Fixed WinRT build (transport re-factoring) (diff) | |
download | ice-fa7430226acd87c37ac70e686fbc6038707e0d11.tar.bz2 ice-fa7430226acd87c37ac70e686fbc6038707e0d11.tar.xz ice-fa7430226acd87c37ac70e686fbc6038707e0d11.zip |
Add stderr logger test and fix logger encoding issues.
Diffstat (limited to 'cpp/test/Ice/logger/Client4.cpp')
-rw-r--r-- | cpp/test/Ice/logger/Client4.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/cpp/test/Ice/logger/Client4.cpp b/cpp/test/Ice/logger/Client4.cpp new file mode 100644 index 00000000000..8a0ba932ef9 --- /dev/null +++ b/cpp/test/Ice/logger/Client4.cpp @@ -0,0 +1,56 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#include <Ice/Ice.h> +#include <TestCommon.h> + +using namespace std; + +namespace +{ + +class Client : public Ice::Application +{ +public: + virtual int + run(int, char*[]) + { + communicator()->getLogger()->trace("info", "XXX"); + return EXIT_SUCCESS; + }; +}; + +} + +int +main(int argc, char* argv[]) +{ +#ifdef _WIN32 + // + // 28605 == ISO 8859-15 codepage + // + int cp = GetConsoleOutputCP(); + SetConsoleOutputCP(CP_UTF8); + IceUtil::setProcessStringConverter(new IceUtil::WindowsStringConverter(28605)); +#else + IceUtil::setProcessStringConverter(new IceUtil::IconvStringConverter<char>("ISO8859-15")); +#endif + Ice::InitializationData id; + id.properties = Ice::createProperties(); + id.properties->load("config.client"); + const string programName = id.properties->getProperty("Ice.ProgramName"); + + Client c; + int status = c.main(argc, argv, id); + +#ifdef _WIN32 + SetConsoleOutputCP(cp); +#endif + return status; +} |