Uses 1319K of libraries. Click here for Pure Java version (7923L/42K).
1 | !7 |
2 | |
3 | cmodule PossibleLogFiles > DynObjectTable<File> {
|
4 | bool showTimestamps, enabled; |
5 | |
6 | start {
|
7 | dontPersist(); |
8 | itemToMap = func(File f) -> Map {
|
9 | long time = f.lastModified(); |
10 | ret litorderedmap( |
11 | "Log File" := dropPrefix(addSlash(f2s(javaxDataDir())), f.getPath()), |
12 | "Program" := unnull(snippetTitle_cached(firstSnippetIDFromPath(f))), |
13 | "Size" := toK(fileSize(f)) + " K", |
14 | "Changed" := /*howManySecondsAgo(time) + " (" +*/ renderHowLongAgo(time) /* + ")"*/,
|
15 | "Last Line" := showTimestamps |
16 | ? shorten(lastLineOfFile(f), 150) |
17 | : simplifyLogLineForDisplay(lastLineOfFile(f))); |
18 | }; |
19 | if (!enabled) ret; |
20 | doEvery(dm_osBooting() ? 30.0 : 0.0, 60.0, r fullUpdate); |
21 | doEvery(3.0, r updateTable); |
22 | } |
23 | |
24 | afterVisualize { pcall {
|
25 | addRowSorter_desc(table, 3); |
26 | rowSorter_setComparators(table, 2, alphaNumComparator(), 3, howLongAgo_comparator()); |
27 | }} |
28 | |
29 | void fullUpdate() { setData(findProbableQuotedLogs()); }
|
30 | |
31 | enhanceFrame {
|
32 | dm_boolFieldMenuItem(f, 'showTimestamps); |
33 | } |
34 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1019444 |
| Snippet name: | Possible Log Files |
| Eternal ID of this version: | #1019444/51 |
| Text MD5: | 1e192eb9e95c99bb400f8928cb0f85ac |
| Transpilation MD5: | 2de4061240e6d67e8f7dd58a872d2e65 |
| Author: | stefan |
| Category: | javax / stefan's os |
| Type: | JavaX source code (Dynamic Module) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2020-01-26 19:54:41 |
| Source code size: | 1102 bytes / 34 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 981 / 2128 |
| Version history: | 50 change(s) |
| Referenced in: | [show references] |