Skip to content

Commit

Permalink
Merge pull request BuildCLI#102 from wheslleyrimar/develop
Browse files Browse the repository at this point in the history
Merge pull request BuildCLI#101 from wheslleyrimar/fix/log

fix(logging): Clean up log output and fix Logback config
  • Loading branch information
wheslleyrimar authored Feb 8, 2025
2 parents 0f123fd + 9b72c2e commit 5e9cac9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
5 changes: 2 additions & 3 deletions src/main/java/org/buildcli/log/SystemOutLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
public class SystemOutLogger {

private static final Logger logger = LoggerFactory.getLogger(BuildCLI.class);

private SystemOutLogger() { }

public static void log(String message) {
logger.info(message);
logger.info("\n");
}
}
16 changes: 9 additions & 7 deletions src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
<configuration>
<configuration debug="false">
<statusListener class="ch.qos.logback.core.status.NopStatusListener" />

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
<pattern>%msg%n</pattern>
</encoder>
</appender>

<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>${user.home}/logs/builcli.log</file>
<file>${user.home}/logs/buildcli.log</file>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}-%msg%n</pattern>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender-ref ref="FILE" />

<root level="DEBUG">
<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
</configuration>

</configuration>

0 comments on commit 5e9cac9

Please sign in to comment.