Skip to content

Commit 518480b

Browse files
RIC-1063: Fixed review comments
1 parent 86e0ed5 commit 518480b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

docs-sources/target-rts/logging.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
It's often useful to print log messages in an application, either as a quick way of throubleshooting a problem without having to use a debugger, or as a more permanent means of reporting errors or other interesting information at runtime. In the latter case it's recommended to use one of the many logging frameworks for C++ that are available. Examples of such frameworks include, but are certainly not limited to:
1+
It's often useful to print log messages in an application, either as a quick way of trouble shooting a problem without having to use a debugger, or as a more permanent means of reporting errors or other interesting information at runtime. In the latter case it's recommended to use one of the many logging frameworks for C++ that are available. Examples of such frameworks include, but are certainly not limited to:
22

33
* [Boost.Log](https://github.com/boostorg/log)
44
* [Apache Log4cxx](https://github.com/apache/logging-log4cxx)
@@ -29,12 +29,12 @@ capsule C {
2929
Note the following:
3030

3131
* To flush the log and make sure the logged message becomes visible you must call `commit()`.
32-
* Use `show()` instead of `log()` to avoid printing a carriage return after the message. Note, however, that all logging functions eventually use the class [RTDiagStream](../targetrts-api/class_r_t_diag_stream) for writing in a thread-safe way to `stderr`. To avoid interleaving printouts in a multi-threaded application it can therefore be better to fully create the string to log (for example using `std::stringstream`) and then print it with a single call to `log()`.
32+
* Use `show()` instead of `log()` to avoid printing a carriage return after the message. Note, however, that all logging functions eventually use the class [RTDiagStream](../targetrts-api/class_r_t_diag_stream.html) for writing in a thread-safe way to `stderr`. To avoid interleaving printouts in a multi-threaded application it can therefore be better to fully create the string to log (for example using `std::stringstream`) and then print it with a single call to `log()`.
3333
* You can print an indented message to the log by calling `crtab()`.
3434
* In addition to strings you can also [log data](#logging-data).
3535

3636
### Logging Data
37-
A log port provides several overloaded versions of `log()` (and `show()`) which let you log the values of variables. There are overloads for most primitive C++ types, and for some types from the TargetRTS such as `RTString`. You can also log objects of user-defined types, provided that they have a [type descriptor](../art-lang/cpp-extensions.md#type-descriptor). Here is an example of logging a few values of different types:
37+
A log port provides several overloaded versions of `log()` (and `show()`) which lets you log the values of variables. There are overloads for most primitive C++ types, and for some types from the TargetRTS such as `RTString`. You can also log objects of user-defined types, provided that they have a [type descriptor](../art-lang/cpp-extensions.md#type-descriptor). Here is an example of logging a few values of different types:
3838

3939
```cpp
4040
struct [[rt::auto_descriptor]] MyType {
@@ -104,7 +104,7 @@ In addition to the actual error message ("Reference full") the text contains inf
104104
* `incarnate` The TargetRTS function that was called when the error occurred.
105105
* `application` The capsule part in which the error occured. The special name `application` denotes the implicit part in which the top capsule instance is located, i.e. the very root of the capsule instance tree.
106106
* `Top` The type (i.e. capsule) of the capsule part in which the error occurred.
107-
* `<machine>` The state of the capsule state machine that is currently active when the error occurred. The special name `<machine>` denotes the implicit state that is active before the first state is activated (i.e. if the error occurs in the initial transition)
107+
* `<machine>` The state of the capsule state machine that is currently active when the error occurred. The special name `<machine>` denotes the implicit state that is active before the first state is activated (i.e. if the error occurs in the initial transition).
108108
* `p` The capsule part that could not be incarnated.
109109
* `-1` The index at which a new capsule instance was attempted to be incarnated. -1 means it was not specified and the first "free" index would be used.
110110

docs-sources/target-rts/message-communication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ myPort.myEvent().send();
2121
- If the sender and receiver controller is the same (intra-thread communication) the message is placed in the internal queue.
2222
- If the sender and receiver controllers are different (inter-thread communication) the message is placed in the incoming queue.
2323

24-
Note that both the internal and incoming message queue is actually an array of queues, one for each [message priority level](#message-priority). The received message is inserted in the end of the queue that matches the priority of the message as specified by the sender. This ensures that messages are handled in priority order, and, within each level of priority, in a FIFO ("first-in-first-out") manner.
24+
Note that both the internal and incoming message queue is actually an array of queues, one for each [message priority level](#message-priority). The received message is inserted at the end of the queue that matches the priority of the message as specified by the sender. This ensures that messages are handled in priority order, and, within each level of priority, in a FIFO ("first-in-first-out") manner.
2525

2626
4. If the message was placed in the incoming queue, it gets transferred to the internal queue in the beginning of the `RTController::dispatch()` function which is called once in each iteration of the controller's event loop. This happens in the function `RTController::acceptIncoming()`.
2727
5. The rest of the `RTController::dispatch()` function checks the contents of the incoming queue, starting with the queue at the highest priority level (`Synchronous`), proceeding with queues at lower priority levels, until the queue at the lowest priority level (`Background`). As soon as it encounters a non-empty queue it dispatches the first message of that queue.

0 commit comments

Comments
 (0)