1 /* 2 * This file is a part of CAST project. 3 * (c) Copyright 2007, AGH University of Science & Technology 4 * https://caribou.iisg.agh.edu.pl/trac/cast 5 * 6 * Licensed under the Eclipse Public License, Version 1.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 * http://www.eclipse.org/legal/epl-v10.html 10 */ 11 /* 12 * File: StdOutLevel.java 13 * Created: 2009-09-02 14 * Author: tmilos 15 * $Id$ 16 */ 17 18 package pl.edu.agh.cast.util.logging; 19 20 import java.io.ObjectStreamException; 21 22 import org.apache.log4j.Level; 23 24 /** 25 * A logging level which should be used for redirecting {@link System#out} to logger. 26 * 27 * @author AGH CAST Team 28 */ 29 public final class StdOutLevel extends Level { 30 31 /** 32 * Serial version UID. 33 */ 34 private static final long serialVersionUID = 3796650667482549218L; 35 36 /** 37 * Private constructor. 38 */ 39 @SuppressWarnings("nls") 40 private StdOutLevel() { 41 super(Level.INFO.toInt() + 13, "STDOUT", Level.INFO.getSyslogEquivalent()); 42 } 43 44 /** 45 * Level for STDOUT activity. 46 */ 47 public static final Level STDOUT = new StdOutLevel(); 48 49 /** 50 * Method to avoid creating duplicate instances when deserializing the object. 51 * 52 * @return the singleton instance of this <code>Level</code> value in this classloader 53 */ 54 protected Object readResolve() throws ObjectStreamException { 55 return STDOUT; 56 } 57 58 }