Package com.google.cloud.logging
Class SourceLocation
- java.lang.Object
-
- com.google.cloud.logging.SourceLocation
-
- All Implemented Interfaces:
Serializable
public final class SourceLocation extends Object implements Serializable
Additional information about the source code location that produced the log entry.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SourceLocation.Builder
A builder forSourceLocation
objects.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getFile()
Returns the source file name.String
getFunction()
Returns the human-readable name of the function or method being invoked, with optional context such as the class or package name.Long
getLine()
Returns the line within the source file.int
hashCode()
static SourceLocation.Builder
newBuilder()
SourceLocation.Builder
toBuilder()
String
toString()
-
-
-
Method Detail
-
newBuilder
public static SourceLocation.Builder newBuilder()
-
getFile
public String getFile()
Returns the source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name.
-
getLine
public Long getLine()
Returns the line within the source file. 1-based; 0 indicates no line number available.
-
getFunction
public String getFunction()
Returns the human-readable name of the function or method being invoked, with optional context such as the class or package name. This information may be used in contexts such as the logs viewer, where a file and line number are less meaningful. The format can vary by language.
-
toBuilder
public SourceLocation.Builder toBuilder()
-
-