Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix some typos #1008

Merged
merged 2 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,20 @@ If you are using Maven without BOM, add this to your dependencies:
If you are using Gradle 5.x or later, add this to your dependencies:

```Groovy
implementation platform('com.google.cloud:libraries-bom:26.0.0')
implementation platform('com.google.cloud:libraries-bom:26.1.0')

implementation 'com.google.cloud:google-cloud-logging'
```
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-logging:3.10.0'
implementation 'com.google.cloud:google-cloud-logging:3.10.2'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-logging" % "3.10.0"
libraryDependencies += "com.google.cloud" % "google-cloud-logging" % "3.10.2"
```

## Authentication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public class Instrumentation {
* Populates entries with instrumentation info which is added in separate log entry
*
* @param logEntries {Iterable<LogEntry>} The list of entries to be populated
* @return {Tuple<Boolean, Iterable<LogEntry>>} containg a flag if instrumentation info was added
* or not and a modified list of log entries
* @return {Tuple<Boolean, Iterable<LogEntry>>} containing a flag if instrumentation info was
* added or not and a modified list of log entries
*/
public static Tuple<Boolean, Iterable<LogEntry>> populateInstrumentationInfo(
Iterable<LogEntry> logEntries) {
Expand Down Expand Up @@ -114,7 +114,7 @@ public static WriteOption[] addPartialSuccessOption(WriteOption[] options) {
* with 'java'. Will be truncated if longer than 14 characters.
* @param libraryVersion {string} The version of the logging library to be reported. Will be
* truncated if longer than 14 characters.
* @returns {LogEntry} The entry with diagnostic instrumentation data.
* @return {LogEntry} The entry with diagnostic instrumentation data.
bpcreech marked this conversation as resolved.
Show resolved Hide resolved
*/
public static LogEntry createDiagnosticEntry(String libraryName, String libraryVersion) {
return createDiagnosticEntry(libraryName, libraryVersion, null);
Expand Down Expand Up @@ -193,7 +193,7 @@ private static Struct createInfoStruct(String libraryName, String libraryVersion
* The package-private helper method used to set the flag which indicates if instrumentation info
* already written or not.
*
* @returns The value of the flag before it was set.
* @return The value of the flag before it was set.
*/
static boolean setInstrumentationStatus(boolean value) {
if (instrumentationAdded == value) return instrumentationAdded;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* <li>Protobuf's {@link Timestamp} and {@link java.time.Instant}
* </ul>
*
* The class complements convertion methods that are currently not supported in the published
* The class complements conversion methods that are currently not supported in the published
* protobuf-java-util. After migrating protobuf-java-util to Java 8 this class can be removed.
*
* @see <a href=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -850,15 +850,15 @@ public void write(Iterable<LogEntry> logEntries, WriteOption... options) {

try {
final Map<Option.OptionType, ?> writeOptions = optionMap(options);
final Boolean logingOptionsPopulateFlag = getOptions().getAutoPopulateMetadata();
final Boolean loggingOptionsPopulateFlag = getOptions().getAutoPopulateMetadata();
final Boolean writeOptionPopulateFlga =
WriteOption.OptionType.AUTO_POPULATE_METADATA.get(writeOptions);
Tuple<Boolean, Iterable<LogEntry>> pair =
Instrumentation.populateInstrumentationInfo(logEntries);
logEntries = pair.y();

if (writeOptionPopulateFlga == Boolean.TRUE
|| (writeOptionPopulateFlga == null && logingOptionsPopulateFlag == Boolean.TRUE)) {
|| (writeOptionPopulateFlga == null && loggingOptionsPopulateFlag == Boolean.TRUE)) {
final MonitoredResource sharedResourceMetadata = RESOURCE.get(writeOptions);
logEntries =
populateMetadata(logEntries, sharedResourceMetadata, this.getClass().getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private String getFunctionName() {
String value = getter.getEnv("K_SERVICE");
if (value == null) {
// keep supporting custom function name if is not provided by default
// for backward compatability only; reconsider removing it after Gen2
// for backward compatibility only; reconsider removing it after Gen2
// environment is enrolled for Cloud Function
value = getter.getEnv("FUNCTION_NAME");
}
Expand All @@ -132,7 +132,7 @@ private String getModuleId() {
return getter.getEnv("GAE_SERVICE");
}
/**
* Heuristic to discover the namespace name of the current environment. There is no determenistic
* Heuristic to discover the namespace name of the current environment. There is no deterministic
* way to discover the namespace name of the process. The name is read from the {@link
* K8S_POD_NAMESPACE_PATH} when available or read from a user defined environment variable
* "NAMESPACE_NAME"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class HttpRequestTest {
private static final String REQUEST_URL = "http://www.example.com";
private static final Long REQUEST_SIZE = 1L;
private static final Integer STATUS = 200;
private static final Long REPONSE_SIZE = 2L;
private static final Long RESPONSE_SIZE = 2L;
private static final String USER_AGENT =
"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)";
private static final String REMOTE_IP = "192.168.1.1";
Expand All @@ -47,7 +47,7 @@ public class HttpRequestTest {
.setRequestUrl(REQUEST_URL)
.setRequestSize(REQUEST_SIZE)
.setStatus(STATUS)
.setResponseSize(REPONSE_SIZE)
.setResponseSize(RESPONSE_SIZE)
.setUserAgent(USER_AGENT)
.setRemoteIp(REMOTE_IP)
.setServerIp(SERVER_IP)
Expand All @@ -65,7 +65,7 @@ public void testBuilder() {
assertEquals(REQUEST_URL, HTTP_REQUEST.getRequestUrl());
assertEquals(REQUEST_SIZE, HTTP_REQUEST.getRequestSize());
assertEquals(STATUS, HTTP_REQUEST.getStatus());
assertEquals(REPONSE_SIZE, HTTP_REQUEST.getResponseSize());
assertEquals(RESPONSE_SIZE, HTTP_REQUEST.getResponseSize());
assertEquals(USER_AGENT, HTTP_REQUEST.getUserAgent());
assertEquals(REMOTE_IP, HTTP_REQUEST.getRemoteIp());
assertEquals(SERVER_IP, HTTP_REQUEST.getServerIp());
Expand Down Expand Up @@ -138,7 +138,7 @@ public void testToAndFromPb() {
assertEquals(REQUEST_URL, httpRequest.getRequestUrl());
assertEquals(REQUEST_SIZE, httpRequest.getRequestSize());
assertEquals(STATUS, httpRequest.getStatus());
assertEquals(REPONSE_SIZE, httpRequest.getResponseSize());
assertEquals(RESPONSE_SIZE, httpRequest.getResponseSize());
assertEquals(USER_AGENT, httpRequest.getUserAgent());
assertEquals(REMOTE_IP, httpRequest.getRemoteIp());
assertEquals(SERVER_IP, httpRequest.getServerIp());
Expand Down