Merge "Bug 1113 - ietf-restconf needs to specify the version of ietf-yangtypes that...
[yangtools.git] / common / checkstyle-logging / src / test / java / org / opendaylight / yangtools / checkstyle / CheckLoggingTestClass.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.yangtools.checkstyle;
10
11 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory;
13
14 public class CheckLoggingTestClass {
15     final Logger logger = LoggerFactory.getLogger(CheckstyleTest.class);
16     private static final java.util.logging.Logger LOG2 = java.util.logging.Logger.getGlobal();
17     private static final Logger LOG = LoggerFactory.getLogger(CheckLoggingTestClass.class);
18     public void foo() {
19         try {
20             logger.debug("foo + bar {}", "foo");
21         } catch(Exception e) {
22             e.printStackTrace();
23             System.out.println(e.getMessage());
24             System.err.print(e.getMessage());
25             logger.debug("foo {}", "bar", e);
26             LOG.info("foo {} {}", e.getMessage(), e);
27         }
28     }
29
30     public void bar(String string, IllegalArgumentException e) {
31         LOG.warn("foo", e);
32         LOG.warn("foo {}", e);
33         LOG.warn("foo", string);
34         LOG.warn("foo {}", string);
35         LOG.warn("foo {}", string, e);
36     }
37 }