| Package | org.osmf.logging |
| Class | public class Log |
| Inheritance | Log Object |
| Language Version: | ActionScript 3.0 |
| Product Version: | OSMF 1.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Related API Elements
Public Properties
| Property | Defined By | ||
|---|---|---|---|
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance. | Object | |
| loggerFactory : LoggerFactory [static]
The LoggerFactory used across the application. | Log | ||
Public Methods
| Method | Defined By | ||
|---|---|---|---|
[static]
Returns a logger for the specified category. | Log | ||
![]() |
Indicates whether an object has a specified property defined. | Object | |
![]() |
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | |
![]() |
Indicates whether the specified property exists and is enumerable. | Object | |
![]() |
Sets the availability of a dynamic property for loop operations. | Object | |
![]() |
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | |
![]() |
Returns the string representation of the specified object. | Object | |
![]() |
Returns the primitive value of the specified object. | Object | |
Property Detail
loggerFactory | property |
loggerFactory:LoggerFactory| Language Version: | ActionScript 3.0 |
| Product Version: | OSMF 1.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
The LoggerFactory used across the application.
Implementation
public static function get loggerFactory():LoggerFactory public static function set loggerFactory(value:LoggerFactory):voidMethod Detail
getLogger | () | method |
public static function getLogger(category:String):Logger| Language Version: | ActionScript 3.0 |
| Product Version: | OSMF 1.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Returns a logger for the specified category.
Parameters
category:String — The category that identifies a particular logger
|
Logger — the logger identified by the category
|
Examples How to use this example
LoggerExample.as
package
{
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import org.osmf.elements.VideoElement;
import org.osmf.logging.Logger;
import org.osmf.logging.Log;
import org.osmf.media.MediaPlayerSprite;
import org.osmf.media.URLResource;
public class LoggerSample extends Sprite
{
public function LoggerSample()
{
super();
Log.loggerFactory = new ExampleLoggerFactory();
logger = Log.getLogger("LoggerSample");
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
var mediaPlayerSprite:MediaPlayerSprite = new MediaPlayerSprite();
var urlResource:URLResource = new URLResource("rtmp://cp67126.edgefcs.net/ondemand/mediapm/strobe/content/test/SpaceAloneHD_sounas_640_500_short");
var videoElement:VideoElement = new VideoElement(urlResource);
addChild(mediaPlayerSprite);
logger.debug("Ready to play video at " + urlResource.url.toString());
mediaPlayerSprite.media = videoElement;
}
private var logger:Logger;
}
}
ExampleLoggerFactory.as
package
{
import org.osmf.logging.Logger;
import org.osmf.logging.LoggerFactory;
public class ExampleLoggerFactory extends LoggerFactory
{
public function ExampleLoggerFactory()
{
super();
}
override public function getLogger(category:String):Logger
{
return new ExampleLogger(category);
}
}
}
ExampleLogger.as
package
{
import org.osmf.logging.Logger;
public class ExampleLogger extends Logger
{
public function ExampleLogger(category:String)
{
super(category);
}
override public function debug(message:String, ... rest):void
{
trace(message);
}
}
}
Thu Dec 6 2018, 01:12 PM -08:00
Hide Inherited Public Properties
Show Inherited Public Properties