Package com.yahoo.log
Class VespaFormat
java.lang.Object
com.yahoo.log.VespaFormat
Deprecated, for removal: This API element is subject to removal in a future version.
Should only be used internally in the log library
Vespa log formatting utility methods.
Contains some code based on LogUtils.java in Cloudname https://github.com/Cloudname/cloudname
written by Bjørn Borud, licensed under the Apache 2.0 license.
- Author:
- arnej27959, bjorncs
-
Constructor Summary
ConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Deprecated, for removal: This API element is subject to removal in a future version.This static method is used to detect if a message needs to be escaped, and if so, performs the escaping.static String
format
(String levelName, String component, String componentPrefix, long millis, String threadId, String serviceName, String formattedMessage, Throwable t) Deprecated, for removal: This API element is subject to removal in a future version.static void
formatException
(Throwable t, StringBuilder sbuf) Deprecated, for removal: This API element is subject to removal in a future version.static void
formatTime
(long time, StringBuilder sbuffer) Deprecated, for removal: This API element is subject to removal in a future version.UseformatTime(Instant)
()}static String
formatTime
(Instant instant) Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
VespaFormat
public VespaFormat()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
escape
Deprecated, for removal: This API element is subject to removal in a future version.This static method is used to detect if a message needs to be escaped, and if so, performs the escaping. Since the common case is most likely that escaping is not needed, the code is optimized for this case. The forbidden characters are:- newline
- tab
- backslash
Also handles the case where the message is
null
and replaces the null message with a tag saying that the value was "(empty)".- Parameters:
s
- String that might need escaping- Returns:
- returns the escaped string
-
formatTime
@Deprecated(since="7", forRemoval=true) public static void formatTime(long time, StringBuilder sbuffer) Deprecated, for removal: This API element is subject to removal in a future version.UseformatTime(Instant)
()} -
formatTime
Deprecated, for removal: This API element is subject to removal in a future version. -
format
@Deprecated(since="7", forRemoval=true) public static String format(String levelName, String component, String componentPrefix, long millis, String threadId, String serviceName, String formattedMessage, Throwable t) Deprecated, for removal: This API element is subject to removal in a future version. -
formatException
@Deprecated(since="7", forRemoval=true) public static void formatException(Throwable t, StringBuilder sbuf) Deprecated, for removal: This API element is subject to removal in a future version.Format throwable into given StringBuffer.- Parameters:
t
- The Throwable we want to formatsbuf
- The stringbuffer into which we wish to format the Throwable
-