forked from mbehr1/smart-log
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.json
417 lines (417 loc) · 11.2 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
{
"name": "smart-log",
"displayName": "Smart-Log",
"description": "Provides analysis and visualization features for text based log files.",
"version": "1.10.0",
"license": "CC-BY-NC-SA-4.0",
"publisher": "mbehr1",
"author": {
"name": "Matthias Behr",
"email": "mbehr+smartlog@mcbehr.de"
},
"repository": {
"type": "git",
"url": "https://github.com/mbehr1/smart-log.git"
},
"bugs": {
"url": "https://github.com/mbehr1/smart-log/issues"
},
"engines": {
"vscode": "^1.43.0"
},
"categories": [
"Other"
],
"activationEvents": [
"*"
],
"capabilities": {
"untrustedWorkspaces": {
"supported": "limited",
"description": "Regex and file configs need to come from a trusted workspace as they can potentially cause harm.",
"restrictedConfigurations": [
"smart-log.timeRegex",
"smart-log.fileConfigs"
]
}
},
"main": "./out/extension.js",
"contributes": {
"configuration": [
{
"title": "Smart-Log",
"properties": {
"smart-log.timeRegex": {
"type": "string",
"description": "Regular expression used to identify the time for a line of the logs. This can be overwritten by timeRegex setting inside each fileConfig. Needs to have at least 6 captures (year, month, date, hour, min, sec) can have a 7th (ms) or only 1 capture (time string that Date() accepts).",
"default": "^([0-2][0-9]|[0-2][0-9][0-9][0-9])\\-([0-1][0-9])\\-([0-3][0-9]) ([0-2][0-9])\\:([0-5][0-9])\\:([0-5][0-9]),([0-9][0-9][0-9])"
},
"smart-log.timeFormat": {
"type": "string",
"description": "Optional time format specifier (details see d3-time-format). If this is provided the timeRegex has to capture one expression that will be parsed according to this specifier. Example '%d/%b/%Y:%H:%M:%S %Z'. If not provided the default Date() constructor will be used."
},
"smart-log.decorations": {
"type": "array",
"items": {
"type": "object",
"title": "decoration",
"properties": {
"id": {
"type": "string",
"description": "Identifier of this decoration for later reference e.g. in events."
},
"renderOptions": {
"type": "object",
"description": "Render options see vs code API DecorationRenderOptions."
}
}
},
"default": [
{
"id": "error",
"renderOptions": {
"borderWidth": "1px",
"borderStyle": "solid",
"overviewRulerColor": "red",
"overviewRulerLane": 7,
"light": {
"borderColor": "red"
},
"dark": {
"borderColor": "red"
}
}
},
{
"id": "warning",
"renderOptions": {
"borderWidth": "1px",
"borderStyle": "dotted",
"overviewRulerColor": "orange",
"overviewRulerLane": 4,
"light": {
"borderColor": "orange"
},
"dark": {
"borderColor": "orange"
}
}
},
{
"id": "note",
"renderOptions": {
"borderWidth": "1px",
"borderStyle": "dotted",
"overviewRulerColor": "blue",
"overviewRulerLane": 1,
"light": {
"borderColor": "blue"
},
"dark": {
"borderColor": "blue"
}
}
}
]
},
"smart-log.fileConfigs": {
"type": "array",
"items": {
"type": "object",
"title": "fileConfig",
"properties": {
"name": {
"type": "string",
"description": "Name to identify the type of file."
},
"identifyRegex": {
"type": "string",
"description": "Regexp to identify this file type. Will be searched in full document. The first matching file type is used."
},
"timeRegex": {
"type": "string",
"description": "Regexp used to identify the time for a line of the logs. If provided it overwrittes the smart-log.timeRegex setting."
},
"timeFormat": {
"type": "string",
"description": "Optional time format specifier (details see d3-time-format). If this is provided the timeRegex has to capture one expression that will be parsed according to this specifier. Example '%d/%b/%Y:%H:%M:%S %Z'. If not provided the default Date() constructor will be used."
},
"events": {
"type": "array",
"items": {
"type": "object",
"title": "eventConfig",
"properties": {
"regex": {
"type": "string",
"description": "Regexp to identify this event. Events are searched line by line."
},
"label": {
"type": "string",
"description": "Label of this event. Can contain {x} format expressions that are replaced by regex x.th captured regex match[x]. If empty defaults to the match[0]"
},
"level": {
"type": "integer",
"description": "Indent level (1-based) of this event. Level 1 events are the upmost ones. Level 0 wont be added to tree-view but can be used for decorations.",
"default": 0
},
"decorationId": {
"type": "string",
"description": "Identifier of the decoration to use. Defaults to none."
},
"icon": {
"type": "string",
"description": "Optional name of a codicon icon. E.g. warning or bug. See https://microsoft.github.io/vscode-codicons/dist/codicon.html for a full list."
},
"timeSyncId": {
"type": "string",
"description": "Optional identifier of a 'time sync event'. This gets broadcasted to other documents with the time and the last regex capture in lower case as value."
},
"timeSyncPrio": {
"type": "integer",
"description": "Optional (needed if timeSyncId is used) priority of the time-sync event. As two documents exchange their events by this prio they decide on who will adjust the time. The event with the highest prio (lowest number) will be used."
}
}
}
}
}
},
"default": [
{
"name": "common log format",
"identifyRegex": "HTTP/",
"timeRegex": "^\\S+ \\S+ \\S+ \\[([^\\]]+)",
"timeFormat": "%d/%b/%Y:%H:%M:%S %Z",
"events": [
{
"level": 1,
"label": "error {2} {1}",
"decorationId": "error",
"regex": "^\\S+ \\S+ \\S+ \\[[^\\]]+\\] \"([A-Z]+ [^ \"]+? HTTP/[0-9.]+)\" (5[0-9]{2}) "
},
{
"level": 2,
"label": "{2} {1}",
"decorationId": "warning",
"regex": "^\\S+ \\S+ \\S+ \\[[^\\]]+\\] \"([A-Z]+ [^ \"]+? HTTP/[0-9.]+)\" (4[0-9]{2}) ",
"icon": "warning"
}
]
},
{
"name": "syslog",
"identifyRegex": "\\s(.*)\\[(\\d*)\\]:",
"timeRegex": "^(.*\\s[0-2][0-9]\\:[0-5][0-9]\\:[0-9][0-9])\\s",
"events": [
{
"label": "error",
"regex": "error",
"decorationId": "error"
},
{
"label": "root: {1}",
"level": 1,
"regex": "\\(root\\)(.*)",
"decorationId": "warning"
}
]
}
],
"description": "File specific configurations. For details see (todo)"
}
}
}
],
"commands": [
{
"command": "smart-log.adjustTime",
"title": "adjust time..."
},
{
"command": "smart-log.sendTime",
"title": "send selected time",
"icon": "$(sync)"
},
{
"command": "smart-log.sendTimeSyncEvents",
"title": "send detected time sync events",
"icon": "$(sync)"
},
{
"command": "smart-log.toggleTimeSync",
"title": "toggle auto time sync",
"icon": "$(sync-ignored)"
},
{
"command": "smart-log.openAsTextDoc",
"title": "open as text document",
"icon": "$(file)"
},
{
"command": "smart-log.openAsTextDiff",
"title": "open as diff to selected",
"icon": "$(diff)"
}
],
"menus": {
"editor/context": [
{
"group": "1_modification",
"command": "smart-log.adjustTime",
"when": "editorLangId == smart-log"
},
{
"group": "0_navigation",
"command": "smart-log.sendTime",
"when": "editorLangId == smart-log"
}
],
"editor/title": [
{
"command": "smart-log.toggleTimeSync",
"alt": "smart-log.sendTimeSyncEvents",
"when": "editorLangId == smart-log",
"group": "navigation"
}
],
"view/item/context": [
{
"command": "smart-log.openAsTextDiff",
"when": "view == smartLogEventsExplorer && viewItem != selected",
"group": "inline"
},
{
"command": "smart-log.openAsTextDoc",
"when": "view == smartLogEventsExplorer && viewItem == selected",
"group": "inline"
}
]
},
"languages": [
{
"id": "smart-log",
"extensions": [
".log",
".txt"
]
}
],
"viewsContainers": {
"activitybar": [
{
"id": "mbehr1Logs",
"title": "Logs (smart-/dlt-logs)",
"icon": "./media/logs.svg"
}
]
},
"views": {
"mbehr1Logs": [
{
"id": "smartLogEventsExplorer",
"name": "events explorer"
}
]
}
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"lint": "eslint src --ext ts",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile && npm run lint",
"test": "node ./out/test/runTest.js"
},
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@types/glob": "^7.1.3",
"@types/mocha": "^7.0.1",
"@types/node": "^12.12.50",
"@types/vscode": "1.43.0",
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0",
"eslint": "^6.8.0",
"glob": "^7.1.6",
"husky": "^4.3.6",
"mocha": "^7.2.0",
"semantic-release": "^17.3.0",
"semantic-release-vsce": "^3.0.1",
"typescript": "^3.9.7",
"vscode-test": "^1.4.0"
},
"dependencies": {
"@types/d3-time-format": "^2.1.1",
"d3-time-format": "^2.2.3",
"vscode-extension-telemetry": "^0.1.6"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"release": {
"branches": [
"master"
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{
"type": "docs",
"scope": "readme",
"release": "patch"
}
]
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md",
"changelogTitle": "# Change log for 'smart-log':"
}
],
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"semantic-release-vsce",
{
"packageVsix": "smart-log.vsix"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "smart-log.vsix",
"label": "smart-log Visual Studio Code extension package"
}
]
}
],
[
"@semantic-release/git",
{
"message": "chore(release): ${nextRelease.version} [skip ci]"
}
]
],
"preset": "conventionalcommits"
}
}