mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Don't require logger to be exposed to window object
This commit is contained in:
@ -16,8 +16,8 @@ function html2canvas(nodeList, options) {
|
||||
var index = html2canvasCloneIndex++;
|
||||
options = options || {};
|
||||
if (options.logging) {
|
||||
window.html2canvas.logging = true;
|
||||
window.html2canvas.start = Date.now();
|
||||
log.options.logging = true;
|
||||
log.options.start = Date.now();
|
||||
}
|
||||
|
||||
options.async = typeof(options.async) === "undefined" ? true : options.async;
|
||||
|
@ -1,5 +1,8 @@
|
||||
module.exports = function() {
|
||||
if (window.html2canvas.logging && window.console && window.console.log) {
|
||||
Function.prototype.bind.call(window.console.log, (window.console)).apply(window.console, [(Date.now() - window.html2canvas.start) + "ms", "html2canvas:"].concat([].slice.call(arguments, 0)));
|
||||
var logger = function() {
|
||||
if (logger.options.logging && window.console && window.console.log) {
|
||||
Function.prototype.bind.call(window.console.log, (window.console)).apply(window.console, [(Date.now() - logger.options.start) + "ms", "html2canvas:"].concat([].slice.call(arguments, 0)));
|
||||
}
|
||||
};
|
||||
|
||||
logger.options = {logging: false};
|
||||
module.exports = logger;
|
||||
|
Reference in New Issue
Block a user