42 | On-screen, ticker-tape-style logging tool
43 | 44 | http://jonbri.github.io/ticker-log
45 | https://github.com/jonbri/ticker-log
46 | https://www.npmjs.com/package/ticker-log
Methods
146 | 147 | 148 | 149 | 150 | 151 | 152 |(inner) config(o)
153 | 154 | 155 | 156 | 157 | 158 |160 | Otherwise, overlay object over configuration object.
161 | Only an api function...doesn't map to a key.
162 | Public+private way of setting configuration properties.
163 | 164 | Example:
165 |
166 | var interval = window.ticker.config().interval;
167 |
168 | // change log speed to 400
169 | window.ticker.config({
170 | interval: 400
171 | });
172 |
173 | Parameters:
184 | 185 | 186 || Name | 191 | 192 | 193 |Type | 194 | 195 | 196 | 197 | 198 | 199 |Description | 200 |
|---|---|---|
o |
209 |
210 |
211 | 212 | 213 | 214 | object 215 | 216 | 217 | 218 | | 219 | 220 | 221 | 222 | 223 | 224 |property/value map to apply | 225 |
-
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
- Source: 264 |
- 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 |
(inner) decreaseLogStartTop()
297 | 298 | 299 | 300 | 301 | 302 |304 | Change starting vertical position (logStartTop) for on-screen logs. 305 |
-
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
- Source: 347 |
- 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 |
(inner) decreaseSpeed()
380 | 381 | 382 | 383 | 384 | 385 |387 | Increase delay interval by adjustmentInterval. 388 |
-
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
- Source: 430 |
- 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 |
(inner) dump()
463 | 464 | 465 | 466 | 467 | 468 |470 | Show configuration properties in output textarea. 471 |
-
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
- Source: 513 |
- 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 |
(inner) filter(matcher)
546 | 547 | 548 | 549 | 550 | 551 |553 | Only an api function...doesn't map to a key. 554 |
Parameters:
565 | 566 | 567 || Name | 572 | 573 | 574 |Type | 575 | 576 | 577 | 578 | 579 | 580 |Description | 581 |
|---|---|---|
matcher |
590 |
591 |
592 | 593 | 594 | 595 | regex 596 | | 597 | 598 | string 599 | 600 | 601 | 602 | | 603 | 604 | 605 | 606 | 607 | 608 |either a string or regex to filter log by | 609 |
-
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
- Source: 648 |
- 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 |
(inner) flip()
681 | 682 | 683 | 684 | 685 | 686 |688 | flip (reverse) order of textarea 689 |
-
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
- Source: 731 |
- 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 |
(inner) help()
764 | 765 | 766 | 767 | 768 | 769 |771 | Show help text on-screen as logs. 772 |
-
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
- Source: 814 |
- 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 |
(inner) increaseLogStartTop()
847 | 848 | 849 | 850 | 851 | 852 |854 | Change starting vertical position (logStartTop) for on-screen logs. 855 |
-
870 |
871 |
872 |
873 |
874 |
875 |
876 |
877 |
878 |
879 |
880 |
881 |
882 |
883 |
884 |
885 |
886 |
887 |
888 |
889 |
890 |
891 |
892 |
893 |
894 |
895 |
896 |
- Source: 897 |
- 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 |
(inner) increaseSpeed()
930 | 931 | 932 | 933 | 934 | 935 |937 | Decrease delay interval by half the adjustmentInterval. 938 |
-
953 |
954 |
955 |
956 |
957 |
958 |
959 |
960 |
961 |
962 |
963 |
964 |
965 |
966 |
967 |
968 |
969 |
970 |
971 |
972 |
973 |
974 |
975 |
976 |
977 |
978 |
979 |
- Source: 980 |
- 983 | 984 | 985 | 986 | 987 | 988 | 989 | 990 |
(inner) kill()
1013 | 1014 | 1015 | 1016 | 1017 | 1018 |1020 | Clear render buffer and remove all ticker log dom elements. 1021 |
-
1036 |
1037 |
1038 |
1039 |
1040 |
1041 |
1042 |
1043 |
1044 |
1045 |
1046 |
1047 |
1048 |
1049 |
1050 |
1051 |
1052 |
1053 |
1054 |
1055 |
1056 |
1057 |
1058 |
1059 |
1060 |
1061 |
1062 |
- Source: 1063 |
- 1066 | 1067 | 1068 | 1069 | 1070 | 1071 | 1072 | 1073 |
(inner) killTextarea()
1096 | 1097 | 1098 | 1099 | 1100 | 1101 |1103 | Remove textarea dom element. 1104 |
-
1119 |
1120 |
1121 |
1122 |
1123 |
1124 |
1125 |
1126 |
1127 |
1128 |
1129 |
1130 |
1131 |
1132 |
1133 |
1134 |
1135 |
1136 |
1137 |
1138 |
1139 |
1140 |
1141 |
1142 |
1143 |
1144 |
1145 |
- Source: 1146 |
- 1149 | 1150 | 1151 | 1152 | 1153 | 1154 | 1155 | 1156 |
(inner) listenToEverything()
1179 | 1180 | 1181 | 1182 | 1183 | 1184 |1186 | Only an api function...doesn't map to a key.
1187 | 1188 | Listen to all console invocations: 1189 |
-
1190 |
- all channels 1191 |
- regardless if backtick provided 1192 |
-
1208 |
1209 |
1210 |
1211 |
1212 |
1213 |
1214 |
1215 |
1216 |
1217 |
1218 |
1219 |
1220 |
1221 |
1222 |
1223 |
1224 |
1225 |
1226 |
1227 |
1228 |
1229 |
1230 |
1231 |
1232 |
1233 |
1234 |
- Source: 1235 |
- 1238 | 1239 | 1240 | 1241 | 1242 | 1243 | 1244 | 1245 |
(inner) macroEdit()
1268 | 1269 | 1270 | 1271 | 1272 | 1273 |1275 | For macro 9.
1276 | Show a textarea where macro can be edited.
1277 | "save" macro when textarea is dismissed. 1278 |
-
1293 |
1294 |
1295 |
1296 |
1297 |
1298 |
1299 |
1300 |
1301 |
1302 |
1303 |
1304 |
1305 |
1306 |
1307 |
1308 |
1309 |
1310 |
1311 |
1312 |
1313 |
1314 |
1315 |
1316 |
1317 |
1318 |
1319 |
- Source: 1320 |
- 1323 | 1324 | 1325 | 1326 | 1327 | 1328 | 1329 | 1330 |
(inner) moveLeft()
1353 | 1354 | 1355 | 1356 | 1357 | 1358 |1360 | Change log container position and alignment of log dom elements. 1361 |
-
1376 |
1377 |
1378 |
1379 |
1380 |
1381 |
1382 |
1383 |
1384 |
1385 |
1386 |
1387 |
1388 |
1389 |
1390 |
1391 |
1392 |
1393 |
1394 |
1395 |
1396 |
1397 |
1398 |
1399 |
1400 |
1401 |
1402 |
- Source: 1403 |
- 1406 | 1407 | 1408 | 1409 | 1410 | 1411 | 1412 | 1413 |
(inner) moveRight()
1436 | 1437 | 1438 | 1439 | 1440 | 1441 |1443 | Change log container position and alignment of log dom elements. 1444 |
-
1459 |
1460 |
1461 |
1462 |
1463 |
1464 |
1465 |
1466 |
1467 |
1468 |
1469 |
1470 |
1471 |
1472 |
1473 |
1474 |
1475 |
1476 |
1477 |
1478 |
1479 |
1480 |
1481 |
1482 |
1483 |
1484 |
1485 |
- Source: 1486 |
- 1489 | 1490 | 1491 | 1492 | 1493 | 1494 | 1495 | 1496 |
(inner) nextChannel()
1519 | 1520 | 1521 | 1522 | 1523 | 1524 |1526 | Switch to listen to next console channel ("log", "warn", etc).
1527 | Order is determined by aChannels. 1528 |
-
1543 |
1544 |
1545 |
1546 |
1547 |
1548 |
1549 |
1550 |
1551 |
1552 |
1553 |
1554 |
1555 |
1556 |
1557 |
1558 |
1559 |
1560 |
1561 |
1562 |
1563 |
1564 |
1565 |
1566 |
1567 |
1568 |
1569 |
- Source: 1570 |
- 1573 | 1574 | 1575 | 1576 | 1577 | 1578 | 1579 | 1580 |
(inner) output(bAll)
1603 | 1604 | 1605 | 1606 | 1607 | 1608 |1610 | Show log text in the "output textarea". 1611 |
Parameters:
1622 | 1623 | 1624 || Name | 1629 | 1630 | 1631 |Type | 1632 | 1633 | 1634 | 1635 | 1636 | 1637 |Description | 1638 |
|---|---|---|
bAll |
1647 |
1648 |
1649 | 1650 | 1651 | 1652 | boolean 1653 | 1654 | 1655 | 1656 | | 1657 | 1658 | 1659 | 1660 | 1661 | 1662 |whether to show all logs ever, 1663 | OR just the current on-screen ones (default: false) | 1664 |
-
1676 |
1677 |
1678 |
1679 |
1680 |
1681 |
1682 |
1683 |
1684 |
1685 |
1686 |
1687 |
1688 |
1689 |
1690 |
1691 |
1692 |
1693 |
1694 |
1695 |
1696 |
1697 |
1698 |
1699 |
1700 |
1701 |
1702 |
- Source: 1703 |
- 1706 | 1707 | 1708 | 1709 | 1710 | 1711 | 1712 | 1713 |
(inner) outputAll()
1736 | 1737 | 1738 | 1739 | 1740 | 1741 |1743 | Api function to show all saved log messages. 1744 |
-
1759 |
1760 |
1761 |
1762 |
1763 |
1764 |
1765 |
1766 |
1767 |
1768 |
1769 |
1770 |
1771 |
1772 |
1773 |
1774 |
1775 |
1776 |
1777 |
1778 |
1779 |
1780 |
1781 |
1782 |
1783 |
1784 |
1785 |
- Source: 1786 |
- 1789 | 1790 | 1791 | 1792 | 1793 | 1794 | 1795 | 1796 |
(inner) pause()
1819 | 1820 | 1821 | 1822 | 1823 | 1824 |1826 | Toggle pauseMode config prop boolean.
1827 | Show "pause" log message if no logs are currently showing. 1828 |
-
1843 |
1844 |
1845 |
1846 |
1847 |
1848 |
1849 |
1850 |
1851 |
1852 |
1853 |
1854 |
1855 |
1856 |
1857 |
1858 |
1859 |
1860 |
1861 |
1862 |
1863 |
1864 |
1865 |
1866 |
1867 |
1868 |
1869 |
- Source: 1870 |
- 1873 | 1874 | 1875 | 1876 | 1877 | 1878 | 1879 | 1880 |
(inner) print(text, o)
1903 | 1904 | 1905 | 1906 | 1907 | 1908 |1910 | Only an api function...doesn't map (directly) to a key.
1911 | 1912 | A configuration object can be passed as the second argument: 1913 |
| key | value 1916 | |
|---|---|
| overrideSilentMode | still print, even if silent mode is on 1918 | |
| internal | do not track in aBuffer. Implies showLineNumbers=>true 1920 | |
| showLineNumbers | no line numbers, overrides global setting 1922 | |
1924 | 1925 | Example:
1926 |
1927 | // show log on-screen
1928 | window.ticker.print('lorum ipsum');
1929 |
1930 | 1931 |
Parameters:
1942 | 1943 | 1944 || Name | 1949 | 1950 | 1951 |Type | 1952 | 1953 | 1954 | 1955 | 1956 | 1957 |Description | 1958 |
|---|---|---|
text |
1967 |
1968 |
1969 | 1970 | 1971 | 1972 | string 1973 | 1974 | 1975 | 1976 | | 1977 | 1978 | 1979 | 1980 | 1981 | 1982 |innerHTML for log dom ref | 1983 |
o |
1990 |
1991 |
1992 | 1993 | 1994 | 1995 | object 1996 | 1997 | 1998 | 1999 | | 2000 | 2001 | 2002 | 2003 | 2004 | 2005 |configuration object | 2006 |
-
2018 |
2019 |
2020 |
2021 |
2022 |
2023 |
2024 |
2025 |
2026 |
2027 |
2028 |
2029 |
2030 |
2031 |
2032 |
2033 |
2034 |
2035 |
2036 |
2037 |
2038 |
2039 |
2040 |
2041 |
2042 |
2043 |
2044 |
- Source: 2045 |
- 2048 | 2049 | 2050 | 2051 | 2052 | 2053 | 2054 | 2055 |
(inner) registerMacro(iNumToRegister, fn)
2078 | 2079 | 2080 | 2081 | 2082 | 2083 |2085 | For macros 0-8.
2086 | Only an api function...doesn't map to a key. 2087 |
Parameters:
2098 | 2099 | 2100 || Name | 2105 | 2106 | 2107 |Type | 2108 | 2109 | 2110 | 2111 | 2112 | 2113 |Description | 2114 |
|---|---|---|
iNumToRegister |
2123 |
2124 |
2125 | 2126 | 2127 | 2128 | int 2129 | 2130 | 2131 | 2132 | | 2133 | 2134 | 2135 | 2136 | 2137 | 2138 |key in aMacros object to write to | 2139 |
fn |
2146 |
2147 |
2148 | 2149 | 2150 | 2151 | function 2152 | 2153 | 2154 | 2155 | | 2156 | 2157 | 2158 | 2159 | 2160 | 2161 |callback function | 2162 |
-
2174 |
2175 |
2176 |
2177 |
2178 |
2179 |
2180 |
2181 |
2182 |
2183 |
2184 |
2185 |
2186 |
2187 |
2188 |
2189 |
2190 |
2191 |
2192 |
2193 |
2194 |
2195 |
2196 |
2197 |
2198 |
2199 |
2200 |
- Source: 2201 |
- 2204 | 2205 | 2206 | 2207 | 2208 | 2209 | 2210 | 2211 |
(inner) reset()
2234 | 2235 | 2236 | 2237 | 2238 | 2239 |2241 | Reverts everything ticker has modified and re-installs from scratch.
2242 | Only an api function...doesn't map to a key. 2243 |
-
2258 |
2259 |
2260 |
2261 |
2262 |
2263 |
2264 |
2265 |
2266 |
2267 |
2268 |
2269 |
2270 |
2271 |
2272 |
2273 |
2274 |
2275 |
2276 |
2277 |
2278 |
2279 |
2280 |
2281 |
2282 |
2283 |
2284 |
- Source: 2285 |
- 2288 | 2289 | 2290 | 2291 | 2292 | 2293 | 2294 | 2295 |
(inner) restoreAndExit()
2318 | 2319 | 2320 | 2321 | 2322 | 2323 |2325 | Stop ticker from doing anything.
2326 | Reset url param.
2327 | Reset console object.
2328 | Only an api function...doesn't map to a key. 2329 |
-
2344 |
2345 |
2346 |
2347 |
2348 |
2349 |
2350 |
2351 |
2352 |
2353 |
2354 |
2355 |
2356 |
2357 |
2358 |
2359 |
2360 |
2361 |
2362 |
2363 |
2364 |
2365 |
2366 |
2367 |
2368 |
2369 |
2370 |
- Source: 2371 |
- 2374 | 2375 | 2376 | 2377 | 2378 | 2379 | 2380 | 2381 |
(inner) runMacro(iMacroSlot)
2404 | 2405 | 2406 | 2407 | 2408 | 2409 |2411 | Also can be called directly.
2412 | Execute macro. 2413 |
Parameters:
2424 | 2425 | 2426 || Name | 2431 | 2432 | 2433 |Type | 2434 | 2435 | 2436 | 2437 | 2438 | 2439 |Description | 2440 |
|---|---|---|
iMacroSlot |
2449 |
2450 |
2451 | 2452 | 2453 | 2454 | int 2455 | 2456 | 2457 | 2458 | | 2459 | 2460 | 2461 | 2462 | 2463 | 2464 |macro in aMacros object to execute | 2465 |
-
2477 |
2478 |
2479 |
2480 |
2481 |
2482 |
2483 |
2484 |
2485 |
2486 |
2487 |
2488 |
2489 |
2490 |
2491 |
2492 |
2493 |
2494 |
2495 |
2496 |
2497 |
2498 |
2499 |
2500 |
2501 |
2502 |
2503 |
- Source: 2504 |
- 2507 | 2508 | 2509 | 2510 | 2511 | 2512 | 2513 | 2514 |
(inner) saveConfig()
2537 | 2538 | 2539 | 2540 | 2541 | 2542 |2544 | Update url (window.location) to "save state".
2545 | Only use config props that have changed.
2546 | Generate url-friendly, json string to use for "ticker" param. 2547 |
-
2562 |
2563 |
2564 |
2565 |
2566 |
2567 |
2568 |
2569 |
2570 |
2571 |
2572 |
2573 |
2574 |
2575 |
2576 |
2577 |
2578 |
2579 |
2580 |
2581 |
2582 |
2583 |
2584 |
2585 |
2586 |
2587 |
2588 |
- Source: 2589 |
- 2592 | 2593 | 2594 | 2595 | 2596 | 2597 | 2598 | 2599 |
(inner) silent()
2622 | 2623 | 2624 | 2625 | 2626 | 2627 |2629 | Toggle silentMode config prop boolean. 2630 |
-
2645 |
2646 |
2647 |
2648 |
2649 |
2650 |
2651 |
2652 |
2653 |
2654 |
2655 |
2656 |
2657 |
2658 |
2659 |
2660 |
2661 |
2662 |
2663 |
2664 |
2665 |
2666 |
2667 |
2668 |
2669 |
2670 |
2671 |
- Source: 2672 |
- 2675 | 2676 | 2677 | 2678 | 2679 | 2680 | 2681 | 2682 |
(inner) test()
2705 | 2706 | 2707 | 2708 | 2709 | 2710 |2712 | Print out test log (plus date). 2713 |