diff --git a/libbeat/management/management.go b/libbeat/management/management.go index 52e03fb69435..509d2978eaed 100644 --- a/libbeat/management/management.go +++ b/libbeat/management/management.go @@ -31,6 +31,7 @@ import ( // Status describes the current status of the beat. type Status int +//go:generate stringer -type=Status const ( // Unknown is initial status when none has been reported. Unknown Status = iota diff --git a/libbeat/management/status_string.go b/libbeat/management/status_string.go new file mode 100644 index 000000000000..d26703bb4f99 --- /dev/null +++ b/libbeat/management/status_string.go @@ -0,0 +1,46 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated by "stringer -type=Status"; DO NOT EDIT. + +package management + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[Unknown-0] + _ = x[Starting-1] + _ = x[Configuring-2] + _ = x[Running-3] + _ = x[Degraded-4] + _ = x[Failed-5] + _ = x[Stopping-6] +} + +const _Status_name = "UnknownStartingConfiguringRunningDegradedFailedStopping" + +var _Status_index = [...]uint8{0, 7, 15, 26, 33, 41, 47, 55} + +func (i Status) String() string { + if i < 0 || i >= Status(len(_Status_index)-1) { + return "Status(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _Status_name[_Status_index[i]:_Status_index[i+1]] +} diff --git a/x-pack/elastic-agent/CHANGELOG.asciidoc b/x-pack/elastic-agent/CHANGELOG.asciidoc index 6a216900089e..cc024758d750 100644 --- a/x-pack/elastic-agent/CHANGELOG.asciidoc +++ b/x-pack/elastic-agent/CHANGELOG.asciidoc @@ -31,6 +31,7 @@ - Fix refresh of monitoring configuration {pull}23619[23619] - Fixed nil pointer during unenroll {pull}23609[23609] - Fixed reenroll scenario {pull}23686[23686] +- Fixed make status readable in the log. {pull}23849[23849] ==== New features