OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 module mojo.log; |
| 6 |
| 7 // Log levels: Levels less than |kLogLevelVerbose| are valid and indicate |
| 8 // greater levels of verbosity. Levels greater than |kLogLevelFatal| are |
| 9 // invalid and should be taken to be equivalent to |kLogLevelFatal|. |
| 10 |
| 11 const int32 kLogLevelVerbose = -1; |
| 12 const int32 kLogLevelInfo = 0; |
| 13 const int32 kLogLevelWarning = 1; |
| 14 const int32 kLogLevelError = 2; |
| 15 const int32 kLogLevelFatal = 3; |
| 16 |
| 17 // TODO(vardhan): Should we split this into ClientEntry and ServiceEntry? |
| 18 // EntryMetadata is only meant to be used by a log service. |
| 19 struct Entry { |
| 20 // Client-supplied information: |
| 21 // Client-side timestamp. |
| 22 int64 timestamp; |
| 23 // Log level: one of |kLogLevel...|. |
| 24 int32 log_level; |
| 25 |
| 26 // The client source location this log originated from. |
| 27 string? source_file; |
| 28 uint32 source_line = 0; |
| 29 |
| 30 // Message. |
| 31 string? message; |
| 32 |
| 33 // Service-supplied information, not set by the client. |
| 34 EntryMetadata? metadata; |
| 35 }; |
| 36 |
| 37 struct EntryMetadata { |
| 38 int64 server_timestamp; |
| 39 string source; |
| 40 }; |
OLD | NEW |