Class Label
java.lang.Object
eu.mulk.quarkus.googlecloud.jsonlogging.Label
A label usable to tag a log message.
Instances of Label can be passed as log parameters to the *f family of logging
functions on Logger.
Example:
logger.logf("Request rejected: unauthorized.", Label.of("requestId", "123"));
Result:
{
"textPayload": "Request rejected: unauthorized.",
"labels": {
"requestId": "123"
}
}
- See Also:
-
Method Summary
-
Method Details
-
of
Constructs aLabelfrom a key (i.e. name) and a value.It is often useful for the key to be a
Stringconstant that is shared by multiple parts of the program.- Parameters:
key- the key (name) of the label.value- the value of the label.- Returns:
- the newly constructed
Label, ready to be passed to a logging function.
-
key
The name of the label.It is often useful for this to be a
Stringconstant that is shared by multiple parts of the program.- Returns:
- the name of the label.
-
value
The value of the label.- Returns:
- the value of the label.
-
equals
-
hashCode
public int hashCode() -
toString
-