| 579 | }; |
| 580 | |
| 581 | var _console_fn = function (name) { |
| 582 | return function (fn) { |
| 583 | var args = Array.prototype.slice.call(arguments, 1); |
| 584 | fn.apply(null, args.concat([function (err) { |
| 585 | var args = Array.prototype.slice.call(arguments, 1); |
| 586 | if (typeof console !== 'undefined') { |
| 587 | if (err) { |
| 588 | if (console.error) { |
| 589 | console.error(err); |
| 590 | } |
| 591 | } |
| 592 | else if (console[name]) { |
| 593 | _forEach(args, function (x) { |
| 594 | console[name](x); |
| 595 | }); |
| 596 | } |
| 597 | } |
| 598 | }])); |
| 599 | }; |
| 600 | }; |
| 601 | async.log = _console_fn('log'); |
| 602 | async.dir = _console_fn('dir'); |
| 603 | /*async.info = _console_fn('info'); |