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

Commit 16ad2ff

Browse files
author
Max Dor
authored
Merge pull request #1 from MrCustomizer/loggingError
Logging error
2 parents ec0556e + 3c10613 commit 16ad2ff

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ build/
44

55
# Intellij IDEA
66
.idea/
7+
out/

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ dependencies {
4040
compile 'com.google.code.gson:gson:2.8.0'
4141

4242
testCompile 'junit:junit:4.12'
43+
testRuntimeOnly 'org.slf4j:slf4j-simple:1.7.25'
4344

4445
deployerJars "org.apache.maven.wagon:wagon-ssh:2.2"
4546
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* matrix-java-sdk - Matrix Client SDK for Java
3+
* Copyright (C) 2017 Arne Augenstein
4+
*
5+
* https://max.kamax.io/
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU Affero General Public License as
9+
* published by the Free Software Foundation, either version 3 of the
10+
* License, or (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU Affero General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Affero General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
package io.kamax.matrix;
21+
22+
import org.junit.Assert;
23+
import org.junit.Test;
24+
import org.slf4j.Logger;
25+
import org.slf4j.LoggerFactory;
26+
import org.slf4j.helpers.NOPLoggerFactory;
27+
28+
import java.net.URISyntaxException;
29+
30+
/**
31+
* A small test class, intended to verify that the logging framework has
32+
* a suitable logging implementation.
33+
*/
34+
public class LoggingDependencyTest {
35+
@Test
36+
public void login() throws URISyntaxException {
37+
if (LoggerFactory.getILoggerFactory() instanceof NOPLoggerFactory) {
38+
Assert.fail("No logging implementation found, using fallback NOP logger");
39+
}
40+
Logger logger = LoggerFactory.getLogger("");
41+
logger.info("If you see this info in the logger, everything is alright");
42+
}
43+
}

0 commit comments

Comments
 (0)