|
logger.Target Property
Sets or returns target for a logger object. Read/write.
object.Target (target)
Arguments
- object
- Required. Always the name of a logger object.
- target
- Optional. If provided, target is a keyword or the path and name of the
file to which the logger will write.
Remarks
Setting target to these values will cause the logger
to write to the following locations:
target is... |
logger writes to... |
"alert" |
an Alert box |
"console" |
the Console window |
a file name (without a path) |
My Documents\target |
a path and file name |
the specified file |
The following example illustrates the use of the Level property.
// create a logger and set the level to DEBUG and write entries to the Console window
var myLogger = new Application.logger();
myLogger.Level(myLogger.LEVEL.DEBUG);
myLogger.trace("trace"); // TRACE is lower than DEBUG, so this won't do anything
myLogger.debug("debug");
myLogger.error("error");
// make the logger write entries to My Documents\mylog.log
// make the logger write entries to My Documents\mylog.log
myLogger.Target("mylog.log");
myLogger.trace("trace"); // TRACE is lower than DEBUG, so this won't do anything
myLogger.debug("debug");
myLogger.error("error");
Applies To:
logger Object
Requirements
|