* Log an error message * @param {object} settings dataTables settings object * @param {int} level log error messages, or display them to the user * @param {string} msg error message * @param {int} tn Technical note id to get more information about the error. * @memberof DataTable#oApi
(settings, level, msg, tn)
| 5806 | * @memberof DataTable#oApi |
| 5807 | */ |
| 5808 | function _fnLog(settings, level, msg, tn) { |
| 5809 | msg = "DataTables warning: " + (settings ? "table id=" + settings.sTableId + " - " : "") + msg |
| 5810 | |
| 5811 | if (tn) { |
| 5812 | msg += ". For more information about this error, please see " + "https://datatables.net/tn/" + tn |
| 5813 | } |
| 5814 | |
| 5815 | if (!level) { |
| 5816 | // Backwards compatibility pre 1.10 |
| 5817 | var ext = DataTable.ext |
| 5818 | var type = ext.sErrMode || ext.errMode |
| 5819 | |
| 5820 | if (settings) { |
| 5821 | _fnCallbackFire(settings, null, "dt-error", [settings, tn, msg], true) |
| 5822 | } |
| 5823 | |
| 5824 | if (type == "alert") { |
| 5825 | alert(msg) |
| 5826 | } else if (type == "throw") { |
| 5827 | throw new Error(msg) |
| 5828 | } else if (typeof type == "function") { |
| 5829 | type(settings, tn, msg) |
| 5830 | } |
| 5831 | } else if (window.console && console.log) { |
| 5832 | console.log(msg) |
| 5833 | } |
| 5834 | } |
| 5835 | |
| 5836 | /** |
| 5837 | * See if a property is defined on one object, if so assign it to the other object |
no test coverage detected