Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Commit 76d6a00

Browse files
authored
Update site, dependencies, breaking change in SLF4J 2.0.10
core: replace Util.report with Reporter.warn, was changed in SLF4J 2.0.10
1 parent 908d242 commit 76d6a00

File tree

23 files changed

+209
-176
lines changed

23 files changed

+209
-176
lines changed

.github/workflows/codeql.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ jobs:
2828

2929
# Initializes the CodeQL tools for scanning.
3030
- name: Initialize CodeQL
31-
uses: github/codeql-action/init@v2
31+
uses: github/codeql-action/init@v3
3232
with:
3333
languages: ${{ matrix.language }}
3434

3535
- name: Autobuild
36-
uses: github/codeql-action/autobuild@v2
36+
uses: github/codeql-action/autobuild@v3
3737

3838
- name: Perform CodeQL Analysis
39-
uses: github/codeql-action/analyze@v2
39+
uses: github/codeql-action/analyze@v3
4040
with:
4141
category: "/language:${{matrix.language}}"

.gitlab-ci.yml

+22-8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ stages:
1818
- test
1919
- verify
2020
- release
21+
- deploy
2122

2223
build:
2324
stage: build
@@ -44,6 +45,10 @@ sast:
4445
variables:
4546
SAST_EXCLUDED_PATHS: jacoco-resources,prism.js
4647

48+
semgrep-sast:
49+
rules:
50+
- if: $CI_COMMIT_TAG == null
51+
4752
coverage:
4853
stage: verify
4954
script:
@@ -59,20 +64,29 @@ codacy:
5964
rules:
6065
- if: $CODACY_PROJECT_TOKEN && $CI_COMMIT_TAG == null
6166

62-
deploy:
67+
release:
6368
stage: release
6469
script:
65-
- ./mvnw $MAVEN_CLI_OPTS -s ci_settings.xml -pl core,logger,json-logger,. -am deploy -ntp -Dchangelist= -Psources,javadocs,sign-and-deploy
66-
only:
67-
- tags
70+
- ./mvnw $MAVEN_CLI_OPTS -s ci_settings.xml -pl core,logger,json-logger,. -am -ntp -DskipTests -Dchangelist= -Pjavadocs,release
71+
rules:
72+
- if: $CI_COMMIT_TAG
73+
- if: $CI_DEFAULT_BRANCH != $CI_COMMIT_BRANCH
74+
when: never
75+
cache:
76+
paths:
77+
- target
6878

6979
pages:
70-
stage: release
80+
stage: deploy
7181
script:
7282
- cp changelog.md src/site/markdown
73-
- ./mvnw $MAVEN_CLI_OPTS -pl . verify site site:stage -Dchangelist= -Pjavadocs,site
83+
- cp contributing.md src/site/markdown
84+
- ./mvnw javadoc:aggregate -Dchangelist= -Pjavadocs
85+
- ./mvnw $MAVEN_CLI_OPTS -pl . -Dchangelist= -Psite
7486
artifacts:
7587
paths:
7688
- public
77-
only:
78-
- tags
89+
rules:
90+
- if: $CI_COMMIT_TAG
91+
- if: $CI_DEFAULT_BRANCH != $CI_COMMIT_BRANCH
92+
when: never

.mvn/wrapper/maven-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
1818
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar

NOTICE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
slf4j-aws-lambda
2-
Copyright 2022-2023 Vitalij Berdinskih
2+
Copyright 2022-2024 Vitalij Berdinskih
33

44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

changelog.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## Unreleased
8+
### Changed
9+
- Update dependencies
10+
- Updage site
11+
- **core:** replace `Util.report` with `Reporter.warn`, was changed in SLF4J 2.0.10
12+
713
## 1.0.2 - 2023-10-16
814
### Changed
915
- Update dependencies

core/pom.xml

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright 2022-2023 Vitalij Berdinskih
3+
Copyright 2022-2024 Vitalij Berdinskih
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -24,17 +24,6 @@
2424
<artifactId>maven-surefire-plugin</artifactId>
2525
<groupId>org.apache.maven.plugins</groupId>
2626
</plugin>
27-
<plugin>
28-
<artifactId>maven-jar-plugin</artifactId>
29-
<configuration>
30-
<archive>
31-
<manifestEntries>
32-
<Automatic-Module-Name>org.slf4j.aws_lambda.core</Automatic-Module-Name>
33-
</manifestEntries>
34-
</archive>
35-
</configuration>
36-
<groupId>org.apache.maven.plugins</groupId>
37-
</plugin>
3827
<plugin>
3928
<artifactId>maven-failsafe-plugin</artifactId>
4029
<groupId>org.apache.maven.plugins</groupId>

core/src/main/java/uk/bot_by/aws_lambda/slf4j/AWSLambdaLogger.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022-2023 Vitalij Berdinskih
2+
* Copyright 2022-2024 Vitalij Berdinskih
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -58,7 +58,7 @@ public class AWSLambdaLogger implements Logger, Serializable {
5858
private final AWSLambdaLoggerConfiguration configuration;
5959
private final AWSLambdaLoggerOutput output;
6060

61-
public AWSLambdaLogger(@NotNull AWSLambdaLoggerConfiguration configuration,
61+
AWSLambdaLogger(@NotNull AWSLambdaLoggerConfiguration configuration,
6262
@NotNull AWSLambdaLoggerOutput output) {
6363
this.configuration = configuration;
6464
this.output = output;

core/src/main/java/uk/bot_by/aws_lambda/slf4j/AWSLambdaLoggerConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022-2023 Vitalij Berdinskih
2+
* Copyright 2022-2024 Vitalij Berdinskih
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

core/src/main/java/uk/bot_by/aws_lambda/slf4j/AWSLambdaLoggerConfigurationProperty.java

+9
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,17 @@ public enum AWSLambdaLoggerConfigurationProperty {
9393
*/
9494
ShowThreadName("showThreadName", "LOG_SHOW_THREAD_NAME", "false");
9595

96+
/**
97+
* Default value of the property.
98+
*/
9699
public final String defaultValue;
100+
/**
101+
* Property name.
102+
*/
97103
public final String propertyName;
104+
/**
105+
* Environment variable name.
106+
*/
98107
public final String variableName;
99108

100109
AWSLambdaLoggerConfigurationProperty(String propertyName, String variableName,

core/src/main/java/uk/bot_by/aws_lambda/slf4j/AWSLambdaLoggerFactory.java

+25-20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022-2023 Vitalij Berdinskih
2+
* Copyright 2022-2024 Vitalij Berdinskih
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@
3333
import org.slf4j.ILoggerFactory;
3434
import org.slf4j.Logger;
3535
import org.slf4j.event.Level;
36-
import org.slf4j.helpers.Util;
36+
import org.slf4j.helpers.Reporter;
3737

3838
/**
3939
* Responsible for building {@link Logger} using the {@link AWSLambdaLogger} implementation.
@@ -126,6 +126,11 @@ public class AWSLambdaLoggerFactory implements ILoggerFactory {
126126
private final boolean showThreadId;
127127
private final boolean showThreadName;
128128

129+
/**
130+
* AWS Lambda Logger Factory.
131+
* <p>
132+
* Looking for a configuration file <em>lambda-logger.properties</em>.
133+
*/
129134
public AWSLambdaLoggerFactory() {
130135
this(CONFIGURATION_FILE);
131136
}
@@ -134,12 +139,11 @@ public AWSLambdaLoggerFactory() {
134139
AWSLambdaLoggerFactory(String configurationFile) {
135140
loggers = new ConcurrentHashMap<>();
136141
properties = loadProperties(configurationFile);
137-
dateTimeFormat = getDateTimeFormat(AWSLambdaLoggerConfigurationProperty.DateTimeFormat);
142+
dateTimeFormat = getDateTimeFormat();
138143
// logLevelSeparator and markerSeparator should be resolved before defaultLoggerLevel
139144
logLevelSeparator = getStringProperty(AWSLambdaLoggerConfigurationProperty.LogLevelSeparator);
140145
markerSeparator = getStringProperty(AWSLambdaLoggerConfigurationProperty.MarkerSeparator);
141-
defaultLoggerLevel = getLoggerLevelProperty(
142-
AWSLambdaLoggerConfigurationProperty.DefaultLogLevel);
146+
defaultLoggerLevel = getLoggerLevelProperty();
143147
levelInBrackets = getBooleanProperty(AWSLambdaLoggerConfigurationProperty.LevelInBrackets);
144148
requestId = getStringProperty(AWSLambdaLoggerConfigurationProperty.RequestId);
145149
showDateTime = getBooleanProperty(AWSLambdaLoggerConfigurationProperty.ShowDateTime);
@@ -192,46 +196,47 @@ private boolean getBooleanProperty(AWSLambdaLoggerConfigurationProperty configur
192196
return Boolean.parseBoolean(getStringProperty(configurationProperty));
193197
}
194198

195-
private DateFormat getDateTimeFormat(AWSLambdaLoggerConfigurationProperty configurationProperty) {
196-
String dateTimeFormatString = getStringProperty(configurationProperty);
199+
private DateFormat getDateTimeFormat() {
200+
var dateTimeFormatString = getStringProperty(
201+
AWSLambdaLoggerConfigurationProperty.DateTimeFormat);
197202

198203
if (nonNull(dateTimeFormatString)) {
199204
try {
200205
return new SimpleDateFormat(dateTimeFormatString);
201206
} catch (IllegalArgumentException exception) {
202-
Util.report("Bad date format in " + CONFIGURATION_FILE + "; will output relative time",
203-
exception);
207+
Reporter.warn(
208+
"Bad date-time format in " + CONFIGURATION_FILE + "; will output relative time");
204209
}
205210
}
206211

207212
return null;
208213
}
209214

210-
private List<AWSLambdaLoggerLevel> getLoggerLevelProperty(
211-
AWSLambdaLoggerConfigurationProperty configurationProperty) {
212-
String value = System.getenv(configurationProperty.variableName);
215+
private List<AWSLambdaLoggerLevel> getLoggerLevelProperty() {
216+
var defaultLogLevelProperty = AWSLambdaLoggerConfigurationProperty.DefaultLogLevel;
217+
var value = System.getenv(defaultLogLevelProperty.variableName);
213218

214219
if (nonNull(value)) {
215220
try {
216221
return parseLoggerLevelString(value);
217222
} catch (IllegalArgumentException exception) {
218-
Util.report("Bad log level in the variable " + configurationProperty.variableName,
219-
exception);
223+
Reporter.warn("Bad log level in the variable " + defaultLogLevelProperty.variableName);
220224
}
221225
}
222226

223-
value = getProperties().getProperty(configurationProperty.propertyName);
227+
value = getProperties().getProperty(defaultLogLevelProperty.propertyName);
224228
if (nonNull(value)) {
225229
try {
226230
return parseLoggerLevelString(value);
227231
} catch (IllegalArgumentException exception) {
228-
Util.report("Bad log level in the property " + configurationProperty.propertyName + " of "
229-
+ CONFIGURATION_FILE, exception);
232+
Reporter.warn(
233+
"Bad log level in the property " + defaultLogLevelProperty.propertyName + " of "
234+
+ CONFIGURATION_FILE);
230235
}
231236
}
232237

233238
return List.of(
234-
AWSLambdaLoggerLevel.builder().level(Level.valueOf(configurationProperty.defaultValue))
239+
AWSLambdaLoggerLevel.builder().level(Level.valueOf(defaultLogLevelProperty.defaultValue))
235240
.build());
236241
}
237242

@@ -252,7 +257,7 @@ private List<AWSLambdaLoggerLevel> getLoggerLevels(String loggerName) {
252257
try {
253258
loggerLevels = parseLoggerLevelString(loggerLevelString);
254259
} catch (IllegalArgumentException exception) {
255-
Util.report("Bad log level of the logger " + loggerName, exception);
260+
Reporter.warn("Bad log level of the logger " + loggerName);
256261
}
257262
}
258263

@@ -304,7 +309,7 @@ private Properties loadProperties(String configurationFile) {
304309
properties.load(configurationInputStream);
305310
} catch (IOException | NullPointerException e) {
306311
// ignored
307-
Util.report(CONFIGURATION_FILE + " is missed");
312+
Reporter.warn(CONFIGURATION_FILE + " is missed");
308313
}
309314

310315
return properties;

core/src/main/java/uk/bot_by/aws_lambda/slf4j/AWSLambdaLoggerLevel.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022-2023 Vitalij Berdinskih
2+
* Copyright 2022-2024 Vitalij Berdinskih
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

core/src/main/java/uk/bot_by/aws_lambda/slf4j/AWSLambdaLoggerOutput.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022-2023 Vitalij Berdinskih
2+
* Copyright 2022-2024 Vitalij Berdinskih
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

core/src/main/java/uk/bot_by/aws_lambda/slf4j/AWSLambdaServiceProvider.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022-2023 Vitalij Berdinskih
2+
* Copyright 2022-2024 Vitalij Berdinskih
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

example-lambda-json/pom.xml

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright 2022-2023 Vitalij Berdinskih
3+
Copyright 2022-2024 Vitalij Berdinskih
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -48,6 +48,13 @@
4848
<groupId>com.github.davidmoten</groupId>
4949
<version>0.2.33</version>
5050
</plugin>
51+
<plugin>
52+
<artifactId>maven-javadoc-plugin</artifactId>
53+
<configuration>
54+
<skip>true</skip>
55+
</configuration>
56+
<groupId>org.apache.maven.plugins</groupId>
57+
</plugin>
5158
</plugins>
5259
<resources>
5360
<resource>
@@ -77,8 +84,8 @@
7784
<dependency>
7885
<artifactId>slf4j-aws-lambda-json-logger</artifactId>
7986
<groupId>uk.bot-by</groupId>
80-
<version>${revision}${changelist}${sha1}</version>
8187
<scope>runtime</scope>
88+
<version>${revision}${changelist}${sha1}</version>
8289
</dependency>
8390
</dependencies>
8491
<groupId>uk.bot-by.bot</groupId>

example-lambda/pom.xml

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
Copyright 2022-2023 Vitalij Berdinskih
3+
Copyright 2022-2024 Vitalij Berdinskih
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -48,6 +48,13 @@
4848
<groupId>com.github.davidmoten</groupId>
4949
<version>0.2.33</version>
5050
</plugin>
51+
<plugin>
52+
<artifactId>maven-javadoc-plugin</artifactId>
53+
<configuration>
54+
<skip>true</skip>
55+
</configuration>
56+
<groupId>org.apache.maven.plugins</groupId>
57+
</plugin>
5158
</plugins>
5259
<resources>
5360
<resource>
@@ -77,8 +84,8 @@
7784
<dependency>
7885
<artifactId>slf4j-aws-lambda-logger</artifactId>
7986
<groupId>uk.bot-by</groupId>
80-
<version>${revision}${changelist}${sha1}</version>
8187
<scope>runtime</scope>
88+
<version>${revision}${changelist}${sha1}</version>
8289
</dependency>
8390
</dependencies>
8491
<groupId>uk.bot-by.bot</groupId>

json-logger/pom.xml

-11
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,6 @@
88
<artifactId>maven-surefire-plugin</artifactId>
99
<groupId>org.apache.maven.plugins</groupId>
1010
</plugin>
11-
<plugin>
12-
<artifactId>maven-jar-plugin</artifactId>
13-
<configuration>
14-
<archive>
15-
<manifestEntries>
16-
<Automatic-Module-Name>org.slf4j.aws_lambda.logger</Automatic-Module-Name>
17-
</manifestEntries>
18-
</archive>
19-
</configuration>
20-
<groupId>org.apache.maven.plugins</groupId>
21-
</plugin>
2211
<plugin>
2312
<artifactId>jacoco-maven-plugin</artifactId>
2413
<groupId>org.jacoco</groupId>

0 commit comments

Comments
 (0)