Skip to content

Commit

Permalink
Merge pull request #21 from eProsima/release/1.7.1
Browse files Browse the repository at this point in the history
Release 1.7.1
  • Loading branch information
richiware committed Feb 20, 2019
2 parents 8ccbdab + cb52fc9 commit 8a562d9
Show file tree
Hide file tree
Showing 9 changed files with 747 additions and 556 deletions.
48 changes: 48 additions & 0 deletions code/CodeTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include <fastrtps/transport/TCPv4TransportDescriptor.h>
#include <fastrtps/types/DynamicDataFactory.h>
#include <fastrtps/utils/IPLocator.h>
#include <fastrtps/log/Log.h>
#include <fastrtps/log/FileConsumer.h>
#include <fastrtps/subscriber/SampleInfo.h>
#include <cpp/security/accesscontrol/GovernanceParser.h>
#include <cpp/security/accesscontrol/PermissionsParser.h>
Expand Down Expand Up @@ -276,6 +278,52 @@ UDPv4TransportDescriptor descriptor;
descriptor.interfaceWhiteList.emplace_back("127.0.0.1");
//!--

//LOG_USAGE_PRINT
logInfo(INFO_MSG, "This is an info message");
logWarning(WARN_MSG, "This is a warning message");
logError(ERROR_MSG, "This is an error message");
//!--

//LOG_USAGE_INFO
logInfo(NEW_CATEGORY, "This log message belong to NEW_CATEGORY category.");
//!--

//LOG_USAGE_VERBOSITY
Log::SetVerbosity(Log::Kind::Warning);
std::regex my_regex("NEW_CATEGORY");
Log::SetCategoryFilter(my_regex);
//!--

/*
//LOG_USAGE_API
//! Enables the reporting of filenames in log entries. Disabled by default.
RTPS_DllAPI static void ReportFilenames(bool);
//! Enables the reporting of function names in log entries. Enabled by default when supported.
RTPS_DllAPI static void ReportFunctions(bool);
//! Sets the verbosity level, allowing for messages equal or under that priority to be logged.
RTPS_DllAPI static void SetVerbosity(Log::Kind);
//! Returns the current verbosity level.
RTPS_DllAPI static Log::Kind GetVerbosity();
//! Sets a filter that will pattern-match against log categories, dropping any unmatched categories.
RTPS_DllAPI static void SetCategoryFilter (const std::regex&);
//! Sets a filter that will pattern-match against filenames, dropping any unmatched categories.
RTPS_DllAPI static void SetFilenameFilter (const std::regex&);
//! Sets a filter that will pattern-match against the provided error string, dropping any unmatched categories.
RTPS_DllAPI static void SetErrorStringFilter (const std::regex&);
//!--
*/

//LOG-CONFIG
Log::ClearConsumers(); // Deactivate StdoutConsumer

// Add FileConsumer consumer
std::unique_ptr<FileConsumer> fileConsumer(new FileConsumer("append.log", true));
Log::RegisterConsumer(std::move(fileConsumer));

// Back to its defaults: StdoutConsumer will be enable and FileConsumer removed.
Log::Reset();
//!--

//CONF_QOS_STATIC_DISCOVERY_CODE
participant_attr.rtps.builtin.use_SIMPLE_EndpointDiscoveryProtocol = false;
participant_attr.rtps.builtin.use_STATIC_EndpointDiscoveryProtocol = true;
Expand Down
33 changes: 33 additions & 0 deletions code/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Here you can find the source code used in the documentation and also the XML examples.
They are located here to test they are right.


# Testing

## Source code

Source code is located in the file `CodeTester.cpp`.
CMake is used to compile the source code.

```
mkdir build && cd build
cmake ..
```

By default it will try to use the same git branch's name to clone FastRTPS.
If you want to use another FastRTPS's branch you have the option `FASTRTPS_BRANCH`.

```bash
mkdir build && cd build
cmake -DFASTRTPS_BRANCH=develop ..
```

## XML examples

XML examples are located in the file `XMLTester.xml`.
The generated application has the functionality to check the XML file against FastRTPS XML parser.
You can use CTest to run the application and check the XML examples.

```bash
ctest -VV
```

0 comments on commit 8a562d9

Please sign in to comment.