//////////////////////////////////////////////////////////////////////////////// // // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. // The ASF licenses this file to You under the Apache License, Version 2.0 // (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.apache.org/licenses/LICENSE-2.0 // // 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. // //////////////////////////////////////////////////////////////////////////////// package mx.olap { /** * The OLAPTrace class controls the generation of trace information * generated by the OLAP classes and written to the log file. * This class uses the trace() method internally to write out the log information. * *

You must set TraceOutputFileEnable=1 in mm.cfg, and use the * Debug Flash Player or AIR Debug Launcher to generate trace output.

* * @see trace() * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public class OLAPTrace { include "../core/Version.as"; //-------------------------------------------------------------------------- // // Class constants // //-------------------------------------------------------------------------- /** * Set to true to enable trace output. * * @default true * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static var traceOn:Boolean = true; /** * The current trace level, which determines the amount of trace information * written to the log file, TRACE_LEVEL_1 writes the least amount of * information to the log file, and TRACE_LEVEL_3 writes the most. * *

All trace information output by a call to the traceMsg() method * with a level argument less than traceLevel * is sent to the log file.

* * @default TRACE_LEVEL_1 * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static var traceLevel:int = 1; /** * Specifies to write minimal trace information to the log file. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static const TRACE_LEVEL_1:int = 1; /** * Specifies to write more trace information to the log file than TRACE_LEVEL_1. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static const TRACE_LEVEL_2:int = 2; /** * Specifies to write the most trace information to the log file. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static const TRACE_LEVEL_3:int = 3; //-------------------------------------------------------------------------- // // Class methods // //-------------------------------------------------------------------------- /** * Writes trace information to the log file *. *

You must set TraceOutputFileEnable=1 in mm.cfg, and use the * Debug Flash Player or AIR Debug Launcher to generate * trace output by calling this method.

* * @param msg The trace message. * * @param level The trace level of the message. * Only trace messages with a level argument less than traceLevel * are sent to the log file. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static function traceMsg(msg:String, level:int=1):void { if (traceOn && level <= traceLevel) trace(msg); } } }