/*----------------------------------------------------------------------------- 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 fever.log.FeverDebug; /** * Defines specific logging channel for configuration process. * *
Sets the {@link #isOn} property to {@code true} to enable logging messages. * ( default {@code false} ). * * @author Romain Ecarnot */ class fever.conf.ConfDebug { //------------------------------------------------------------------------- // Public Properties //------------------------------------------------------------------------- /** Enables or disables configuration debugging. (default is {@code false}) */ public static var isOn : Boolean = false; /** Specific log channel for frameworks. */ public static var channel : LogChannel = FeverDebug.channel; //------------------------------------------------------------------------- // Public API //------------------------------------------------------------------------- /** * Dispatches a {@code DEBUG} message */ public static function DEBUG( o ) : Void { if ( ConfDebug.isOn ) Logger.LOG( o, LogLevel.DEBUG, ConfDebug.channel ); } /** * Dispatches a {@code INFO} message */ public static function INFO( o ) : Void { if ( ConfDebug.isOn ) Logger.LOG( o, LogLevel.INFO, ConfDebug.channel ); } /** * Dispatches a {@code WARN} message */ public static function WARN( o ) : Void { if ( ConfDebug.isOn ) Logger.LOG( o, LogLevel.WARN, ConfDebug.channel ); } /** * Dispatches a {@code ERROR} message */ public static function ERROR( o ) : Void { if ( ConfDebug.isOn ) Logger.LOG( o, LogLevel.ERROR, ConfDebug.channel ); } /** * Dispatches a {@code FATAL} message */ public static function FATAL( o ) : Void { if ( ConfDebug.isOn ) Logger.LOG( o, LogLevel.FATAL, ConfDebug.channel ); } /** * Dispatches a custom level message */ public static function LOG( o, level : LogLevel ) : Void { if ( ConfDebug.isOn ) Logger.LOG( o, level, ConfDebug.channel ); } //------------------------------------------------------------------------- // Private implementation //------------------------------------------------------------------------- private function ConfDebug() { } }