KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > grlea > log > test > SimpleLoggingClass


1 package org.grlea.log.test;
2
3 // $Id: SimpleLoggingClass.java,v 1.2 2006/07/13 12:44:56 grlea Exp $
4
// Copyright (c) 2004-2006 Graham Lea. All rights reserved.
5

6 // Licensed under the Apache License, Version 2.0 (the "License");
7
// you may not use this file except in compliance with the License.
8
// You may obtain a copy of the License at
9
//
10
// http://www.apache.org/licenses/LICENSE-2.0
11
//
12
// Unless required by applicable law or agreed to in writing, software
13
// distributed under the License is distributed on an "AS IS" BASIS,
14
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
// See the License for the specific language governing permissions and
16
// limitations under the License.
17

18 import org.grlea.log.SimpleLog;
19 import org.grlea.log.SimpleLogger;
20
21 /**
22  * <p></p>
23  *
24  * @author Graham Lea
25  * @version $Revision: 1.2 $
26  */

27 public class
28 SimpleLoggingClass
29 {
30    private final SimpleLogger log;
31
32    public
33    SimpleLoggingClass()
34    {
35       log = new SimpleLogger(getClass());
36    }
37
38    public
39    SimpleLoggingClass(SimpleLog simpleLog)
40    {
41       log = new SimpleLogger(simpleLog, getClass());
42    }
43
44    public
45    SimpleLoggingClass(SimpleLog simpleLog, Object JavaDoc instanceId)
46    {
47       log = new SimpleLogger(simpleLog, getClass(), instanceId);
48    }
49
50    public void
51    doSomeLogging()
52    {
53       log.fatal("Test of Fatal");
54       log.error("Test of Error");
55       log.warn("Test of Warn");
56       log.info("Test of Info");
57       log.debug("Test of Debug");
58       log.verbose("Test of Verbose");
59       log.ludicrous("Test of Ludicrous");
60
61       log.entry("doSomeLogging()");
62       log.exit("doSomeLogging()");
63    }
64 }
Popular Tags