Commit Graph

9 Commits

Author SHA1 Message Date
Carlos Chinchilla
c0cbc16ec8 pw_log_rpc: Add unit tests, docs, & error handling
Add pw_log_rpc unit tests and documentation.
Add an enum to dictacte how to handle server writer errors in
RpcLogDrain.

Test: unit tests pass
Change-Id: Ib22dd3414cf344fddd6f179d43fd4d533ba12fd8
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/56931
Pigweed-Auto-Submit: Carlos Chinchilla <cachinchilla@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Keir Mierle <keir@google.com>
2021-09-09 00:22:20 +00:00
Carlos Chinchilla
5e645b2d26 pw_log_rpc: Create Log RPC service & streams
An RpcLogStream matches a Multisink::Drain with an RPC writer and is
identified by the RPC channel ID. A persistent log stream can be created
by assigning an open writer to the RpcLogStream, or can be set when the
stream is inactive by the RPC Log service.
A map is provided to collect all log streams, persistent and dynamic. It
makes it easy to assign a writer to a log stream, or to flush all the
log streams.
Flushing is delegated to whatever owns the log stream map. Included is a
single thread, single Multisink::Listener that sequentially flushes the
log streams. Future work can make use of a work queue.

Test: sample app using raw strings log entries works with pw_console
calling:
```for payload in rpcs.pw.log.LogService.Listen.invoke():
    for entry in payload.entries:
        LOG.info("%s", entry.message)```

No-Docs-Update-Reason: module is still under work.

Change-Id: I20fdbabe3aeb298a22c27e7a655e77c3cfaa2c13
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/56001
Commit-Queue: Carlos Chinchilla <cachinchilla@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
2021-09-03 17:31:12 +00:00
Carlos Chinchilla
f50a10c2c0 pw_log_multisink: Remove unfinished module
This module was under construction and unfinished.
Disable pw_log_rpc sources depending on the deleted module.

Change-Id: I631ac3d086434ef0dbc8824c432c897336e203dc
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/53861
Reviewed-by: Prashanth Swaminathan <prashanthsw@google.com>
Commit-Queue: Carlos Chinchilla <cachinchilla@google.com>
Pigweed-Auto-Submit: Carlos Chinchilla <cachinchilla@google.com>
2021-07-26 21:49:00 +00:00
Prashanth Swaminathan
5ef2aa2f3b pw_log_multisink: Move log queue and proto
Moves LogQueue to pw_multisink and log.proto to pw_log.

Change-Id: Icf81e9f6178e2a07a5927053d9d7f29e3153429b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22461
Pigweed-Auto-Submit: Prashanth Swaminathan <prashanthsw@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
2020-11-17 18:25:41 +00:00
Prashanth Swaminathan
652977da99 pw_log_rpc: Add RPC command for logs
Adds Logs.Get RPC to acquire the logs from log queue.

Change-Id: I5a3d93604906f4dd0471e50964fe36a61c66797c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21960
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Prashanth Swaminathan <prashanthsw@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-11-06 23:28:38 +00:00
Alexei Frolov
8e30d46622 pw_protobuf_compiler: Rename generated GN targets
This updates generated protobuf targets to use the format
<target>.<generator> instead of <target>_<generator> to improve
readability.

Change-Id: I52d1e398d5bbece7f79ae87e9a1df7fdce880a6b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22222
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
2020-10-23 19:30:06 +00:00
Wyatt Hepler
d49f8fe3f3 BUILD.gn files: Improve import formatting
The "# gn-format disable" comments are no longer necessary. Delete these
comments and reformat with a Vim macro and gn format.

Change-Id: Ia62c40ad73eef91187d0d443d6e3b0fa723e5aa9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21380
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-10-15 18:12:55 +00:00
Prashanth Swaminathan
fce26ba0e5 pw_log_rpc: Add log queue implementation
The log protobuf format has been modified to accept signed integers for
the elapsed time, to account for negative deltas.

Change-Id: I3fbc4a1b1dd9cdd5402cd621d6dcf5ae3ec6ecc5
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19040
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Prashanth Swaminathan <prashanthsw@google.com>
2020-10-07 15:49:21 +00:00
Prashanth Swaminathan
e9cf376ae5 pw_log_rpc: Add logging module protos
Adds just the proto files from the in-progress logging module.

Change-Id: Ibe8ca60aaaf053cdfb184ec8dd413da49fc3b288
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/18780
Commit-Queue: Prashanth Swaminathan <prashanthsw@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-09-24 18:05:01 +00:00