| // Copyright 2020 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.validate.logs; |
| |
| using zx; |
| using fuchsia.diagnostics.stream; |
| |
| /// A small(ish) limit on the length of argument names is used because argument names are expected |
| /// to be used repeatedly, many times. |
| const MAX_ARG_NAME_LENGTH uint32 = 256; |
| |
| type PuppetInfo = struct { |
| tag string:optional; |
| pid zx.Koid; |
| tid zx.Koid; |
| }; |
| |
| type RecordSpec = struct { |
| file string:MAX_ARG_NAME_LENGTH; |
| line uint32; |
| record fuchsia.diagnostics.stream.Record; |
| }; |
| |
| @discoverable |
| closed protocol LogSinkPuppet { |
| /// Returns the information the puppet knows about itself. |
| strict GetInfo() -> (struct { |
| info PuppetInfo; |
| }); |
| |
| /// Logs a record. |
| strict EmitLog(struct { |
| spec RecordSpec; |
| }) -> (); |
| |
| /// Disables the interest listener |
| strict StopInterestListener() -> (); |
| }; |