Skip to content

Commit b8ce89b

Browse files
author
Pankaj Agrawal
committed
Resolve merge conflicts
1 parent 5d44452 commit b8ce89b

30 files changed

+393
-49
lines changed

.flattened-pom.xml

+12-13
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,23 @@
4242
</snapshotRepository>
4343
</distributionManagement>
4444
<properties>
45-
<cobertura-maven-plugin.version>2.7</cobertura-maven-plugin.version>
46-
<maven-source-plugin.version>2.4</maven-source-plugin.version>
47-
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
48-
<lambda.core.version>1.2.1</lambda.core.version>
49-
<jackson.version>2.11.0</jackson.version>
5045
<maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
51-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
52-
<log4j.version>2.13.3</log4j.version>
46+
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
47+
<cobertura-maven-plugin.version>2.7</cobertura-maven-plugin.version>
5348
<aspectj.version>1.9.6</aspectj.version>
49+
<aspectj-maven-plugin.version>1.12.1</aspectj-maven-plugin.version>
50+
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
5451
<jacoco-maven-plugin.version>0.8.5</jacoco-maven-plugin.version>
55-
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
56-
<maven.compiler.source>1.8</maven.compiler.source>
57-
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
58-
<revision>0.1.0-SNAPSHOT</revision>
59-
<maven.compiler.target>1.8</maven.compiler.target>
6052
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
61-
<aspectj-maven-plugin.version>1.12.1</aspectj-maven-plugin.version>
53+
<maven.compiler.target>1.8</maven.compiler.target>
54+
<maven-source-plugin.version>2.4</maven-source-plugin.version>
55+
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
56+
<log4j.version>2.13.3</log4j.version>
57+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
58+
<lambda.core.version>1.2.1</lambda.core.version>
59+
<jackson.version>2.11.0</jackson.version>
6260
<aws.xray.recorder.version>2.4.0</aws.xray.recorder.version>
61+
<maven.compiler.source>1.8</maven.compiler.source>
6362
</properties>
6463
<dependencyManagement>
6564
<dependencies>

.java-version

-1
This file was deleted.

example/HelloWorldFunction/pom.xml

+11-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
<dependencies>
1616
<dependency>
1717
<groupId>software.amazon.lambda</groupId>
18-
<artifactId>aws-lambda-powertools-java</artifactId>
18+
<artifactId>powertools-tracing</artifactId>
19+
<version>0.1.0-SNAPSHOT</version>
20+
</dependency>
21+
<dependency>
22+
<groupId>software.amazon.lambda</groupId>
23+
<artifactId>powertools-logging</artifactId>
1924
<version>0.1.0-SNAPSHOT</version>
2025
</dependency>
2126
<dependency>
@@ -66,7 +71,11 @@
6671
<aspectLibraries>
6772
<aspectLibrary>
6873
<groupId>software.amazon.lambda</groupId>
69-
<artifactId>aws-lambda-powertools-java</artifactId>
74+
<artifactId>powertools-tracing</artifactId>
75+
</aspectLibrary>
76+
<aspectLibrary>
77+
<groupId>software.amazon.lambda</groupId>
78+
<artifactId>powertools-logging</artifactId>
7079
</aspectLibrary>
7180
</aspectLibraries>
7281
</configuration>

example/HelloWorldFunction/src/main/java/helloworld/App.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
import com.amazonaws.xray.entities.Entity;
1717
import org.apache.logging.log4j.LogManager;
1818
import org.apache.logging.log4j.Logger;
19-
import software.amazon.lambda.logging.PowerLogger;
20-
import software.amazon.lambda.logging.PowerToolsLogging;
21-
import software.amazon.lambda.tracing.PowerToolsTracing;
22-
import software.amazon.lambda.tracing.PowerTracer;
19+
import software.amazon.lambda.powertools.logging.PowerLogger;
20+
import software.amazon.lambda.powertools.logging.PowerToolsLogging;
21+
import software.amazon.lambda.powertools.tracing.PowerToolsTracing;
22+
import software.amazon.lambda.powertools.tracing.PowerTracer;
2323

24-
import static software.amazon.lambda.tracing.PowerTracer.putMetadata;
25-
import static software.amazon.lambda.tracing.PowerTracer.withEntitySubsegment;
24+
import static software.amazon.lambda.powertools.tracing.PowerTracer.putMetadata;
25+
import static software.amazon.lambda.powertools.tracing.PowerTracer.withEntitySubsegment;
2626

2727
/**
2828
* Handler for requests to Lambda function.

example/HelloWorldFunction/src/main/java/helloworld/AppStream.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import com.amazonaws.services.lambda.runtime.Context;
99
import com.amazonaws.services.lambda.runtime.RequestStreamHandler;
1010
import com.fasterxml.jackson.databind.ObjectMapper;
11-
import software.amazon.lambda.logging.PowerToolsLogging;
11+
import software.amazon.lambda.powertools.logging.PowerToolsLogging;
1212

1313
public class AppStream implements RequestStreamHandler {
1414
private static final ObjectMapper mapper = new ObjectMapper();

powertools-core/src/main/java/software/amazon/lambda/powertools/core/internal/LambdaHandlerProcessor.java

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/*
2+
* Copyright 2020 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
114
package software.amazon.lambda.powertools.core.internal;
215

316
import java.io.InputStream;
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,35 @@
1+
/*
2+
* Copyright 2020 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
114
package software.amazon.lambda.powertools.logging;
215

316
import org.apache.logging.log4j.ThreadContext;
417

18+
/**
19+
* A class of helper functions to add additional functionality to PowerToolsLogging.
20+
*
21+
* {@see PowerToolsLogging}
22+
*/
523
public class PowerLogger {
624

7-
public static void customKey(String key, String value) {
25+
/**
26+
* Appends an additional key and value to each log entry made. Duplicate values
27+
* for the same key will be replaced with the latest.
28+
*
29+
* @param key The name of the key to be logged
30+
* @param value The value to be logged
31+
*/
32+
public static void appendKey(String key, String value) {
833
ThreadContext.put(key, value);
934
}
1035
}

powertools-logging/src/main/java/software/amazon/lambda/powertools/logging/PowerToolsLogging.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/*
2+
* Copyright 2020 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
114
package software.amazon.lambda.powertools.logging;
215

316
import java.lang.annotation.ElementType;
@@ -40,7 +53,7 @@
4053
* <p>By default {@code PowerToolsLogging} will not log the event which has trigger the invoke of the Lambda function.
4154
* This can be enabled using {@code @PowerToolsLogging(logEvent = true)}.</p>
4255
*
43-
* <p>To append additional keys to each log entry you can use {@link PowerLogger#customKey(String, String)}</p>
56+
* <p>To append additional keys to each log entry you can use {@link PowerLogger#appendKey(String, String)}</p>
4457
*/
4558
@Retention(RetentionPolicy.RUNTIME)
4659
@Target(ElementType.METHOD)

powertools-logging/src/main/java/software/amazon/lambda/powertools/logging/internal/DefaultLambdaFields.java

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/*
2+
* Copyright 2020 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
114
package software.amazon.lambda.powertools.logging.internal;
215

316
import com.amazonaws.services.lambda.runtime.Context;

powertools-logging/src/main/java/software/amazon/lambda/powertools/logging/internal/LambdaLoggingAspect.java

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/*
2+
* Copyright 2020 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
114
package software.amazon.lambda.powertools.logging.internal;
215

316
import java.io.ByteArrayInputStream;

powertools-logging/src/test/java/software/amazon/lambda/powertools/logging/PowerLoggerTest.java

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1+
/*
2+
* Copyright 2020 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
114
package software.amazon.lambda.powertools.logging;
215

316
import org.apache.logging.log4j.ThreadContext;
417
import org.junit.jupiter.api.BeforeEach;
518
import org.junit.jupiter.api.Test;
6-
import software.amazon.lambda.powertools.logging.PowerLogger;
719

820
import static org.assertj.core.api.Assertions.assertThat;
921

@@ -17,7 +29,7 @@ void setUp() {
1729

1830
@Test
1931
void shouldSetCustomKeyOnThreadContext() {
20-
PowerLogger.customKey("test", "value");
32+
PowerLogger.appendKey("test", "value");
2133

2234
assertThat(ThreadContext.getImmutableContext())
2335
.hasSize(1)

powertools-logging/src/test/java/software/amazon/lambda/powertools/logging/handlers/PowerLogToolEnabled.java

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/*
2+
* Copyright 2020 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
114
package software.amazon.lambda.powertools.logging.handlers;
215

316
import com.amazonaws.services.lambda.runtime.Context;

powertools-logging/src/test/java/software/amazon/lambda/powertools/logging/handlers/PowerLogToolEnabledForStream.java

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/*
2+
* Copyright 2020 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
114
package software.amazon.lambda.powertools.logging.handlers;
215

316
import java.io.InputStream;

powertools-logging/src/test/java/software/amazon/lambda/powertools/logging/handlers/PowerToolDisabled.java

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/*
2+
* Copyright 2020 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
114
package software.amazon.lambda.powertools.logging.handlers;
215

316
import com.amazonaws.services.lambda.runtime.Context;

powertools-logging/src/test/java/software/amazon/lambda/powertools/logging/handlers/PowerToolDisabledForStream.java

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/*
2+
* Copyright 2020 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
114
package software.amazon.lambda.powertools.logging.handlers;
215

316
import java.io.InputStream;

powertools-logging/src/test/java/software/amazon/lambda/powertools/logging/handlers/PowerToolLogEventEnabled.java

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/*
2+
* Copyright 2020 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
114
package software.amazon.lambda.powertools.logging.handlers;
215

316
import com.amazonaws.services.lambda.runtime.Context;

powertools-logging/src/test/java/software/amazon/lambda/powertools/logging/handlers/PowerToolLogEventEnabledForStream.java

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/*
2+
* Copyright 2020 Amazon.com, Inc. or its affiliates.
3+
* Licensed under the Apache License, Version 2.0 (the
4+
* "License"); you may not use this file except in compliance
5+
* with the License. You may obtain a copy of the License at
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Unless required by applicable law or agreed to in writing, software
8+
* distributed under the License is distributed on an "AS IS" BASIS,
9+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
* See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*
13+
*/
114
package software.amazon.lambda.powertools.logging.handlers;
215

316
import java.io.IOException;

0 commit comments

Comments
 (0)