/*----------------------------------------------------------------------------- The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1.1.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is Fever Framework code. The Initial Developer of the Original Code is Romain Ecarnot. Portions created by Initial Developer are Copyright (C) 2006 the Initial Developer. All Rights Reserved. Contributor(s): Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -----------------------------------------------------------------------------*/ import com.bourre.log.LogChannel; import com.bourre.log.Logger; import com.bourre.log.LogLevel; import com.bourre.utils.ClassUtils; /** * Defines Fever and Pixlib internal * logging channel. * *
All Fever logging messages and Pixlib'ones are dispatched in this * log channel. * *
Sets the {@link #isOn} property to {@code true} to enable internal * logging messages. ( default {@code false} ). * * @author Romain Ecarnot */ class fever.log.FeverDebug { //------------------------------------------------------------------------- // Public Properties //------------------------------------------------------------------------- /** Enables or disables Fever / Pixlib debugging. (default is {@code false}) */ public static var isOn : Boolean = false; /** Specific log channel for frameworks. */ public static var channel : LogChannel = new LogChannel( ClassUtils.getFullyQualifiedClassName( new FeverDebug() ) ); //------------------------------------------------------------------------- // Public API //------------------------------------------------------------------------- /** * Dispatches a {@code DEBUG} message */ public static function DEBUG( o ) : Void { if ( FeverDebug.isOn ) Logger.LOG( o, LogLevel.DEBUG, FeverDebug.channel ); } /** * Dispatches a {@code INFO} message */ public static function INFO( o ) : Void { if ( FeverDebug.isOn ) Logger.LOG( o, LogLevel.INFO, FeverDebug.channel ); } /** * Dispatches a {@code WARN} message */ public static function WARN( o ) : Void { if ( FeverDebug.isOn ) Logger.LOG( o, LogLevel.WARN, FeverDebug.channel ); } /** * Dispatches a {@code ERROR} message */ public static function ERROR( o ) : Void { if ( FeverDebug.isOn ) Logger.LOG( o, LogLevel.ERROR, FeverDebug.channel ); } /** * Dispatches a {@code FATAL} message */ public static function FATAL( o ) : Void { if ( FeverDebug.isOn ) Logger.LOG( o, LogLevel.FATAL, FeverDebug.channel ); } /** * Dispatches a custom level message */ public static function LOG( o, level : LogLevel ) : Void { if ( FeverDebug.isOn ) Logger.LOG( o, level, FeverDebug.channel ); } //------------------------------------------------------------------------- // Private implementation //------------------------------------------------------------------------- private function FeverDebug() { } }