Skip to content

Commit

Permalink
Update parent POM 54 (w/ reformat) (#15)
Browse files Browse the repository at this point in the history
W/ source reformat
  • Loading branch information
cstamas authored May 23, 2024
1 parent 7af6a77 commit 0b8183d
Show file tree
Hide file tree
Showing 15 changed files with 1,183 additions and 1,219 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>io.takari</groupId>
<artifactId>takari</artifactId>
<version>50</version>
<version>54</version>
</parent>

<groupId>io.takari.maven</groupId>
Expand Down Expand Up @@ -131,10 +131,10 @@
<executions>
<execution>
<id>maven-distro</id>
<phase>package</phase>
<goals>
<goal>provision</goal>
</goals>
<phase>package</phase>
<configuration>
<outputDirectory>${project.build.directory}/maven-distro</outputDirectory>
</configuration>
Expand All @@ -147,10 +147,10 @@
<executions>
<execution>
<id>integration-test</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<phase>integration-test</phase>
<configuration>
<includes>**/*IT.java</includes>
</configuration>
Expand Down
47 changes: 23 additions & 24 deletions src/main/java/io/takari/maven/logback/BuildRollingPolicy.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,40 @@
*/
package io.takari.maven.logback;

import java.io.File;

import ch.qos.logback.core.rolling.FixedWindowRollingPolicy;
import ch.qos.logback.core.rolling.TriggeringPolicy;
import java.io.File;

/**
* {@link FixedWindowRollingPolicy} that triggers log file rollover on each build.
*
*
* <pre>
* {@code
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>build.log</file>
<rollingPolicy class="io.takari.maven.logback.BuildRollingPolicy">
<fileNamePattern>build-%i.log</fileNamePattern>
<maxIndex>2</maxIndex>
</rollingPolicy>
<encoder>
<pattern>%date %level %msg%n</pattern>
</encoder>
</appender>
* <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
* <file>build.log</file>
* <rollingPolicy class="io.takari.maven.logback.BuildRollingPolicy">
* <fileNamePattern>build-%i.log</fileNamePattern>
* <maxIndex>2</maxIndex>
* </rollingPolicy>
* <encoder>
* <pattern>%date %level %msg%n</pattern>
* </encoder>
* </appender>
* }
*/
public class BuildRollingPolicy<E> extends FixedWindowRollingPolicy implements TriggeringPolicy<E> {

@Override
public boolean isTriggeringEvent(File activeFile, E event) {
return false;
}
@Override
public boolean isTriggeringEvent(File activeFile, E event) {
return false;
}

@Override
public void start() {
boolean rollover = new File(getActiveFileName()).exists();
super.start();
if (rollover) {
rollover();
@Override
public void start() {
boolean rollover = new File(getActiveFileName()).exists();
super.start();
if (rollover) {
rollover();
}
}
}
}
16 changes: 8 additions & 8 deletions src/main/java/io/takari/maven/logback/ConsoleAppender.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
* console logging performance.
*/
public class ConsoleAppender extends ch.qos.logback.core.ConsoleAppender<ILoggingEvent> {
@Override
protected void subAppend(ILoggingEvent event) {
SLF4JPrintStream.enterPrivileged();
try {
super.subAppend(event);
} finally {
SLF4JPrintStream.leavePrivileged();
@Override
protected void subAppend(ILoggingEvent event) {
SLF4JPrintStream.enterPrivileged();
try {
super.subAppend(event);
} finally {
SLF4JPrintStream.leavePrivileged();
}
}
}
}
Loading

0 comments on commit 0b8183d

Please sign in to comment.