AndroidLog.sys.mjs |
Native Android logging for JavaScript, wrapped for use by Log.sys.mjs.
// Import it as a ESM:
import { AndroidAppender } from "resource://gre/modules/AndroidLog.sys.mjs";
// Add the appender to a Log.sys.mjs appender:
import { Log } from "resource://gre/modules/Log.sys.mjs";
let logger = Log.repository.getLogger("Example");
logger.addAppender(new AndroidAppender());
// Log with the normal Log.sys.mjs API:
logger.info("This is an info message.");
Note: Logger names will automatically be prepended with "Gecko" before being
logged to the system logger, if they do not already have a "Gecko" prefix.
|
3176 |