| 套件 | org.osmf.logging |
| 類別 | public class Logger |
| 繼承 | Logger Object |
| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
相關 API 元素
| 屬性 | 定義自 | ||
|---|---|---|---|
| category : String [唯讀]
The category value for the logger. | Logger | ||
![]() | constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | |
| 方法 | 定義自 | ||
|---|---|---|---|
Constructor. | Logger | ||
Logs a message with a "debug" level. | Logger | ||
Logs a message with a "error" level. | Logger | ||
Logs a message with a "fatal" level. | Logger | ||
![]() |
指出物件是否有已定義的指定屬性。 | Object | |
Logs a message with a "info" level. | Logger | ||
![]() |
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | |
![]() |
指出指定的屬性是否存在,以及是否可列舉。 | Object | |
![]() |
為迴圈作業設定動態屬性的可用性。 | Object | |
![]() |
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | |
![]() |
會傳回指定之物件的字串形式。 | Object | |
![]() |
會傳回指定之物件的基本值。 | Object | |
Logs a message with a "warn" level. | Logger | ||
category | 屬性 |
Logger | () | 建構函式 |
debug | () | 方法 |
public function debug(message:String, ... rest):void| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Logs a message with a "debug" level.
Debug messages are informational messages that are fine-grained, and intended to be helpful when debugging.
參數
message:String — The information to log. This string can contain special
special marker characters of the form {x}, where x is a zero-based
index that will be replaced with the additional parameters found at
that index if specified.
| |
... rest — Additional parameters that can be subsituted in the
message parameter at each "{x}" location, where x is an zero-based
integer index into the Array of values specified.
|
error | () | 方法 |
public function error(message:String, ... rest):void| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Logs a message with a "error" level.
Error messages are intended to capture error events that might still allow the application to continue running.
參數
message:String — The information to log. This string can contain special
special marker characters of the form {x}, where x is a zero-based
index that will be replaced with the additional parameters found at
that index if specified.
| |
... rest — Additional parameters that can be subsituted in the
message parameter at each "{x}" location, where x is an zero-based
integer index into the Array of values specified.
|
fatal | () | 方法 |
public function fatal(message:String, ... rest):void| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Logs a message with a "fatal" level.
Fatal messages are intended to capture error events that are likely to lead to application failure.
參數
message:String — The information to log. This string can contain special
special marker characters of the form {x}, where x is a zero-based
index that will be replaced with the additional parameters found at
that index if specified.
| |
... rest — Additional parameters that can be subsituted in the
message parameter at each "{x}" location, where x is an zero-based
integer index into the Array of values specified.
|
info | () | 方法 |
public function info(message:String, ... rest):void| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Logs a message with a "info" level.
Info messages are intended to be informational, as opposed to indicating a concern.
參數
message:String — The information to log. This string can contain special
special marker characters of the form {x}, where x is a zero-based
index that will be replaced with the additional parameters found at
that index if specified.
| |
... rest — Additional parameters that can be subsituted in the
message parameter at each "{x}" location, where x is an zero-based
integer index into the Array of values specified.
|
warn | () | 方法 |
public function warn(message:String, ... rest):void| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Logs a message with a "warn" level.
Warn messages are intended to warn of events that could be harmful to the operation of the application.
參數
message:String — The information to log. This string can contain special
special marker characters of the form {x}, where x is a zero-based
index that will be replaced with the additional parameters found at
that index if specified.
| |
... rest — Additional parameters that can be subsituted in the
message parameter at each "{x}" location, where x is an zero-based
integer index into the Array of values specified.
|
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;
}
}
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);
}
}
}
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);
}
}
}
Tue Jun 12 2018, 03:47 PM Z
隱藏繼承公用屬性
顯示繼承公用屬性