1import { config } from '../config.js'; 2 3// Fonction debug 4// TODO: Créer un rapport de bug (stockage dans objet history) et transmission en overlay 5const log = (tag, tag_name, data, data2 = '', data3 = '', force_debug = false) => { 6 if (config.debug || force_debug) { 7 let style = ''; 8 let table = false; 9 10 tag_name = '%c' + tag_name; 11 12 switch (tag) { 13 case 'tag': 14 style = 'color:magenta'; 15 break; 16 17 case 'event': 18 style = 'color:forestgreen'; 19 break; 20 21 case 'data': 22 style = 'background:darkmagenta;color:white;padding:3px;border-radius:2px'; 23 break; 24 25 case 'info': 26 style = 'background:gray;color:white;padding:3px;border-radius:2px'; 27 break; 28 29 case 'alert': 30 style = 'background:orange;color:white;padding:3px;border-radius:2px'; 31 break; 32 33 case 'warning': 34 style = 'background:red;color:white;padding:3px;border-radius:2px'; 35 break; 36 37 case 'success': 38 style = 'background:green;color:white;padding:3px;border-radius:2px'; 39 break; 40 41 case 'table': 42 style = 'color:tomato;font-size:17px;border-bottom:1px solid tomato;padding:10px'; 43 table = data; 44 break; 45 } 46 47 if (table) { 48 console.log(tag_name, style); 49 console.table(data); 50 } else { 51 console.log(tag_name, style, data, data2, data3); 52 } 53 } 54} 55 56export { log };
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.