You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Broaden error!() to cover any user-initiated action that fails to do
what was expected (e.g. failed hotplug or live migration), not only
unrecoverable startup errors. Retarget info!() at operators and users,
clarify the warn!() and debug!() audiences, and document trace!().
Part of cloud-hypervisor#8440.
Co-authored-by: Philipp Schuster <phip1611@gmail.com>
Signed-off-by: Tushar Khatri <hello@tusharkhatri.in>
Copy file name to clipboardExpand all lines: docs/logging.md
+30-12Lines changed: 30 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,33 +13,51 @@ The number of `-v` parameters passed to the `cloud-hypervisor` binary will deter
13
13
14
14
### `error!()`
15
15
16
-
For immediate, unrecoverable errors where it does not make sense for the execution to continue as the behaviour of the VM is considerably impacted.
16
+
For any user-initiated action that cannot be carried out as expected, as
17
+
well as serious or fatal conditions within the VMM itself. This covers two
18
+
cases:
17
19
18
-
Cloud Hypervisor should exit shortly after reporting this error (with a non-zero exit code). Generally this should be used during initial construction of the VM state before the virtual CPUs have begun running code.
20
+
- A requested operation fails with material impact, even if Cloud
21
+
Hypervisor can continue running (e.g. a failed device hotplug, live
22
+
migration, snapshot/restore, or resize). From the user's perspective the
23
+
action they asked for did not happen, so it is an error to them.
24
+
- An unrecoverable condition where Cloud Hypervisor cannot continue and
25
+
exits with a non-zero code (e.g. conflicting command line options, or a
26
+
required file that is not present).
19
27
20
-
A typical situation where this might occur is when the user is using command line options that conflict with each other or is trying to use a file that is not present on the filesystem.
21
-
22
-
Users should react to this error by checking their initial VM configuration.
28
+
Users should react by checking their configuration or the requested
29
+
operation.
23
30
24
31
### `warn!()`
25
32
26
-
A serious problem has occurred but the execution of the VM can continue although some functionality might be impacted.
27
-
28
-
A typical example of where this level of message should be generated is during an API call request that cannot be fulfilled.
29
-
30
-
The user should investigate the meaning of this warning and take steps to ensure the correct functionality.
33
+
For abnormal conditions that neither prevent a user-initiated action nor
34
+
seriously impact the VM. These are user-facing and developer-facing
35
+
warnings. A typical example is an ineffectual out-of-bounds access that the
36
+
VMM safely ignores.
31
37
32
38
### `info!()`
33
39
34
40
Use `-v` to enable.
35
41
36
-
This level is for the benefit of developers. It should be used for sporadic and infrequent messages. The same message should not "spam" the logs. The VM should be usable when this level of debugging is enabled and trying to use `stdin/stdout` and the logs are going to `stderr`.
42
+
Primarily targeted at operators and users. For important but infrequent
43
+
normal conditions, events, and state changes that are meaningful in production. The same message
44
+
should not "spam" the logs, and the VM should remain usable when this level
45
+
is enabled (e.g. using stdin/stdout while the logs go to stderr).
37
46
38
47
### `debug!()`
39
48
40
49
Use `-vv` to enable.
41
50
42
-
For the most verbose of logging messages. It is acceptable to "spam" the log with repeated invocations of the same message. This level of logging would be combined with `--log-file`.
51
+
Developer-facing diagnostic information. It is acceptable to repeat the same
52
+
message here.
53
+
54
+
### `trace!()`
55
+
56
+
Use `-vvv` to enable.
57
+
58
+
The most verbose level, for very detailed developer-facing information. As
59
+
with `debug!()`, repeated messages are acceptable. This level is typically
0 commit comments