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

Logging error #1

Merged
merged 3 commits into from
Sep 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ build/

# Intellij IDEA
.idea/
out/
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ dependencies {
compile 'com.google.code.gson:gson:2.8.0'

testCompile 'junit:junit:4.12'
testRuntimeOnly 'org.slf4j:slf4j-simple:1.7.25'

deployerJars "org.apache.maven.wagon:wagon-ssh:2.2"
}
Expand Down
43 changes: 43 additions & 0 deletions src/test/java/io/kamax/matrix/LoggingDependencyTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* matrix-java-sdk - Matrix Client SDK for Java
* Copyright (C) 2017 Arne Augenstein
*
* https://max.kamax.io/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.kamax.matrix;

import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.helpers.NOPLoggerFactory;

import java.net.URISyntaxException;

/**
* A small test class, intended to verify that the logging framework has
* a suitable logging implementation.
*/
public class LoggingDependencyTest {
@Test
public void login() throws URISyntaxException {
if (LoggerFactory.getILoggerFactory() instanceof NOPLoggerFactory) {
Assert.fail("No logging implementation found, using fallback NOP logger");
}
Logger logger = LoggerFactory.getLogger("");
logger.info("If you see this info in the logger, everything is alright");
}
}