Commit Graph

4 Commits

Author SHA1 Message Date
Carlos Chinchilla
59f3d43da1 pw_log & pw_log_rpc: Rename proto service name
- Remove redundant "Service" word from proto service name.
- Properly update the packed messages count used in dropped message
  count.
- Replace server writer deprecated open() with active().

No-Docs-Update-Reason: Fixed intended behavior.
Change-Id: I045ed50ce2f823909ff555881acc3ecbea3e8d3f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/61920
Pigweed-Auto-Submit: Carlos Chinchilla <cachinchilla@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2021-09-22 18:16:27 +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
Wyatt Hepler
0d4c9169cd pw_log: Update proto
- Update proto to use a single bytes field for optionally tokenized
  fields.
- Start with a minimal set of fields, but document fields planned for
  future expansion.

Change-Id: I5af8e65335001ffda03acc31e5077edbca9deff3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/47780
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2021-06-08 18:22:32 +00:00
Wyatt Hepler
76c3a5cd46 pw_log: Move pw_log proto
Declare log.proto in pw_log rather than pw_log_proto. The log proto is
properly part of pw_log, rather than a standalone module.

Change-Id: I853f28b36a41a2a94564d61ea2e916d9c21076c3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/47220
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2021-05-27 02:04:03 +00:00