yeet
This commit is contained in:
12
node_modules/logkitty/build/android/AndroidFilter.d.ts
generated
vendored
Normal file
12
node_modules/logkitty/build/android/AndroidFilter.d.ts
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
import { IFilter, Entry } from '../types';
|
||||
export default class AndroidFilter implements IFilter {
|
||||
private readonly minPriority;
|
||||
private filter;
|
||||
constructor(minPriority?: number);
|
||||
setFilterByTag(tags: string[]): void;
|
||||
setFilterByApp(applicationId: string, adbPath?: string): void;
|
||||
setFilterByMatch(regexes: RegExp[]): void;
|
||||
setCustomFilter(patterns: string[]): void;
|
||||
shouldInclude(entry: Entry): boolean;
|
||||
}
|
||||
//# sourceMappingURL=AndroidFilter.d.ts.map
|
1
node_modules/logkitty/build/android/AndroidFilter.d.ts.map
generated
vendored
Normal file
1
node_modules/logkitty/build/android/AndroidFilter.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"AndroidFilter.d.ts","sourceRoot":"","sources":["../../src/android/AndroidFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAM1C,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,OAAO;IACnD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,MAAM,CAAS;gBAEX,WAAW,GAAE,MAAU;IAQnC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE;IAU7B,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;IAOtD,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE;IAalC,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE;IAoBlC,aAAa,CAAC,KAAK,EAAE,KAAK;CAG3B"}
|
67
node_modules/logkitty/build/android/AndroidFilter.js
generated
vendored
Normal file
67
node_modules/logkitty/build/android/AndroidFilter.js
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _adb = require("./adb");
|
||||
|
||||
var _constants = require("./constants");
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
class AndroidFilter {
|
||||
constructor(minPriority = 0) {
|
||||
_defineProperty(this, "minPriority", void 0);
|
||||
|
||||
_defineProperty(this, "filter", void 0);
|
||||
|
||||
this.minPriority = minPriority; // Default filter by all
|
||||
|
||||
this.filter = entry => {
|
||||
return entry.priority >= this.minPriority;
|
||||
};
|
||||
}
|
||||
|
||||
setFilterByTag(tags) {
|
||||
this.filter = entry => {
|
||||
return Boolean(entry.priority >= this.minPriority && entry.tag && tags.indexOf(entry.tag) > -1);
|
||||
};
|
||||
}
|
||||
|
||||
setFilterByApp(applicationId, adbPath) {
|
||||
const pid = (0, _adb.getApplicationPid)(applicationId, adbPath);
|
||||
|
||||
this.filter = entry => {
|
||||
return entry.priority >= this.minPriority && entry.pid === pid;
|
||||
};
|
||||
}
|
||||
|
||||
setFilterByMatch(regexes) {
|
||||
this.filter = entry => {
|
||||
return entry.priority >= this.minPriority && Boolean(regexes.find(reg => Boolean(entry.messages.find(message => reg.test(message)))));
|
||||
};
|
||||
}
|
||||
|
||||
setCustomFilter(patterns) {
|
||||
const tagFilters = patterns.reduce((acc, pattern) => {
|
||||
const [tag, priority] = pattern.split(':');
|
||||
return { ...acc,
|
||||
[tag]: _constants.Priority.fromLetter(priority)
|
||||
};
|
||||
}, {});
|
||||
|
||||
this.filter = entry => {
|
||||
return entry.tag && entry.priority >= (tagFilters[entry.tag] || _constants.Priority.SILENT) || entry.priority >= (tagFilters['*'] || _constants.Priority.UNKNOWN);
|
||||
};
|
||||
}
|
||||
|
||||
shouldInclude(entry) {
|
||||
return this.filter(entry);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = AndroidFilter;
|
||||
//# sourceMappingURL=AndroidFilter.js.map
|
1
node_modules/logkitty/build/android/AndroidFilter.js.map
generated
vendored
Normal file
1
node_modules/logkitty/build/android/AndroidFilter.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/android/AndroidFilter.ts"],"names":["AndroidFilter","constructor","minPriority","filter","entry","priority","setFilterByTag","tags","Boolean","tag","indexOf","setFilterByApp","applicationId","adbPath","pid","setFilterByMatch","regexes","find","reg","messages","message","test","setCustomFilter","patterns","tagFilters","reduce","acc","pattern","split","Priority","fromLetter","SILENT","UNKNOWN","shouldInclude"],"mappings":";;;;;;;AACA;;AACA;;;;AAIe,MAAMA,aAAN,CAAuC;AAIpDC,EAAAA,WAAW,CAACC,WAAmB,GAAG,CAAvB,EAA0B;AAAA;;AAAA;;AACnC,SAAKA,WAAL,GAAmBA,WAAnB,CADmC,CAEnC;;AACA,SAAKC,MAAL,GAAeC,KAAD,IAAkB;AAC9B,aAAOA,KAAK,CAACC,QAAN,IAAkB,KAAKH,WAA9B;AACD,KAFD;AAGD;;AAEDI,EAAAA,cAAc,CAACC,IAAD,EAAiB;AAC7B,SAAKJ,MAAL,GAAeC,KAAD,IAAkB;AAC9B,aAAOI,OAAO,CACZJ,KAAK,CAACC,QAAN,IAAkB,KAAKH,WAAvB,IACEE,KAAK,CAACK,GADR,IAEEF,IAAI,CAACG,OAAL,CAAaN,KAAK,CAACK,GAAnB,IAA0B,CAAC,CAHjB,CAAd;AAKD,KAND;AAOD;;AAEDE,EAAAA,cAAc,CAACC,aAAD,EAAwBC,OAAxB,EAA0C;AACtD,UAAMC,GAAG,GAAG,4BAAkBF,aAAlB,EAAiCC,OAAjC,CAAZ;;AACA,SAAKV,MAAL,GAAeC,KAAD,IAAkB;AAC9B,aAAOA,KAAK,CAACC,QAAN,IAAkB,KAAKH,WAAvB,IAAsCE,KAAK,CAACU,GAAN,KAAcA,GAA3D;AACD,KAFD;AAGD;;AAEDC,EAAAA,gBAAgB,CAACC,OAAD,EAAoB;AAClC,SAAKb,MAAL,GAAeC,KAAD,IAAkB;AAC9B,aACEA,KAAK,CAACC,QAAN,IAAkB,KAAKH,WAAvB,IACAM,OAAO,CACLQ,OAAO,CAACC,IAAR,CAAcC,GAAD,IACXV,OAAO,CAACJ,KAAK,CAACe,QAAN,CAAeF,IAAf,CAAqBG,OAAD,IAAqBF,GAAG,CAACG,IAAJ,CAASD,OAAT,CAAzC,CAAD,CADT,CADK,CAFT;AAQD,KATD;AAUD;;AAEDE,EAAAA,eAAe,CAACC,QAAD,EAAqB;AAClC,UAAMC,UAAqC,GAAGD,QAAQ,CAACE,MAAT,CAC5C,CAACC,GAAD,EAAiCC,OAAjC,KAAqD;AACnD,YAAM,CAAClB,GAAD,EAAMJ,QAAN,IAAkBsB,OAAO,CAACC,KAAR,CAAc,GAAd,CAAxB;AACA,aAAO,EACL,GAAGF,GADE;AAEL,SAACjB,GAAD,GAAOoB,oBAASC,UAAT,CAAoBzB,QAApB;AAFF,OAAP;AAID,KAP2C,EAQ5C,EAR4C,CAA9C;;AAUA,SAAKF,MAAL,GAAeC,KAAD,IAAkB;AAC9B,aACGA,KAAK,CAACK,GAAN,IACCL,KAAK,CAACC,QAAN,KAAmBmB,UAAU,CAACpB,KAAK,CAACK,GAAP,CAAV,IAAyBoB,oBAASE,MAArD,CADF,IAEA3B,KAAK,CAACC,QAAN,KAAmBmB,UAAU,CAAC,GAAD,CAAV,IAAmBK,oBAASG,OAA/C,CAHF;AAKD,KAND;AAOD;;AAEDC,EAAAA,aAAa,CAAC7B,KAAD,EAAe;AAC1B,WAAO,KAAKD,MAAL,CAAYC,KAAZ,CAAP;AACD;;AAhEmD","sourcesContent":["import { IFilter, Entry } from '../types';\nimport { getApplicationPid } from './adb';\nimport { Priority } from './constants';\n\ntype Filter = (entry: Entry) => boolean;\n\nexport default class AndroidFilter implements IFilter {\n private readonly minPriority: number;\n private filter: Filter;\n\n constructor(minPriority: number = 0) {\n this.minPriority = minPriority;\n // Default filter by all\n this.filter = (entry: Entry) => {\n return entry.priority >= this.minPriority;\n };\n }\n\n setFilterByTag(tags: string[]) {\n this.filter = (entry: Entry) => {\n return Boolean(\n entry.priority >= this.minPriority &&\n entry.tag &&\n tags.indexOf(entry.tag) > -1\n );\n };\n }\n\n setFilterByApp(applicationId: string, adbPath?: string) {\n const pid = getApplicationPid(applicationId, adbPath);\n this.filter = (entry: Entry) => {\n return entry.priority >= this.minPriority && entry.pid === pid;\n };\n }\n\n setFilterByMatch(regexes: RegExp[]) {\n this.filter = (entry: Entry) => {\n return (\n entry.priority >= this.minPriority &&\n Boolean(\n regexes.find((reg: RegExp) =>\n Boolean(entry.messages.find((message: string) => reg.test(message)))\n )\n )\n );\n };\n }\n\n setCustomFilter(patterns: string[]) {\n const tagFilters: { [key: string]: number } = patterns.reduce(\n (acc: { [key: string]: number }, pattern: string) => {\n const [tag, priority] = pattern.split(':');\n return {\n ...acc,\n [tag]: Priority.fromLetter(priority),\n };\n },\n {}\n );\n this.filter = (entry: Entry) => {\n return (\n (entry.tag &&\n entry.priority >= (tagFilters[entry.tag] || Priority.SILENT)) ||\n entry.priority >= (tagFilters['*'] || Priority.UNKNOWN)\n );\n };\n }\n\n shouldInclude(entry: Entry) {\n return this.filter(entry);\n }\n}\n"],"file":"AndroidFilter.js"}
|
8
node_modules/logkitty/build/android/AndroidParser.d.ts
generated
vendored
Normal file
8
node_modules/logkitty/build/android/AndroidParser.d.ts
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import { IParser, Entry } from '../types';
|
||||
export default class AndroidParser implements IParser {
|
||||
static timeRegex: RegExp;
|
||||
static headerRegex: RegExp;
|
||||
splitMessages(raw: string): string[];
|
||||
parseMessages(messages: string[]): Entry[];
|
||||
}
|
||||
//# sourceMappingURL=AndroidParser.d.ts.map
|
1
node_modules/logkitty/build/android/AndroidParser.d.ts.map
generated
vendored
Normal file
1
node_modules/logkitty/build/android/AndroidParser.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"AndroidParser.d.ts","sourceRoot":"","sources":["../../src/android/AndroidParser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAG1C,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,OAAO;IACnD,MAAM,CAAC,SAAS,EAAE,MAAM,CAAoD;IAC5E,MAAM,CAAC,WAAW,EAAE,MAAM,CAAkC;IAE5D,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE;IAepC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE;CAmD3C"}
|
69
node_modules/logkitty/build/android/AndroidParser.js
generated
vendored
Normal file
69
node_modules/logkitty/build/android/AndroidParser.js
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _dayjs = _interopRequireDefault(require("dayjs"));
|
||||
|
||||
var _constants = require("./constants");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
class AndroidParser {
|
||||
splitMessages(raw) {
|
||||
const messages = [];
|
||||
let data = raw.toString();
|
||||
let match = data.match(AndroidParser.timeRegex);
|
||||
|
||||
while (match) {
|
||||
const timeHeader = match[0];
|
||||
data = data.slice((match.index || 0) + timeHeader.length);
|
||||
const nextMatch = data.match(AndroidParser.timeRegex);
|
||||
const body = nextMatch ? data.slice(0, nextMatch.index) : data;
|
||||
messages.push(`${timeHeader} ${body}`);
|
||||
match = nextMatch;
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
parseMessages(messages) {
|
||||
return messages.map(rawMessage => {
|
||||
const timeMatch = rawMessage.match(AndroidParser.timeRegex);
|
||||
|
||||
if (!timeMatch) {
|
||||
throw new Error(`Time regex was not matched in message: ${rawMessage}`);
|
||||
}
|
||||
|
||||
const headerMatch = rawMessage.slice(timeMatch[0].length).match(AndroidParser.headerRegex) || ['', 'U', 'unknown', '-1'];
|
||||
const [, priority, tag, pid] = headerMatch;
|
||||
return {
|
||||
platform: 'android',
|
||||
date: (0, _dayjs.default)().set('month', parseInt(timeMatch[1], 10)).set('day', parseInt(timeMatch[2], 10)).set('hour', parseInt(timeMatch[3], 10)).set('minute', parseInt(timeMatch[4], 10)).set('second', parseInt(timeMatch[5], 10)).set('millisecond', 0),
|
||||
pid: parseInt(pid.trim(), 10) || 0,
|
||||
priority: _constants.Priority.fromLetter(priority),
|
||||
tag: tag.trim() || 'unknown',
|
||||
messages: [rawMessage.slice(timeMatch[0].length + headerMatch[0].length).trim()]
|
||||
};
|
||||
}).reduce((acc, entry) => {
|
||||
if (acc.length > 0 && acc[acc.length - 1].date.isSame(entry.date) && acc[acc.length - 1].tag === entry.tag && acc[acc.length - 1].pid === entry.pid && acc[acc.length - 1].priority === entry.priority) {
|
||||
acc[acc.length - 1].messages.push(...entry.messages);
|
||||
return acc;
|
||||
}
|
||||
|
||||
return [...acc, entry];
|
||||
}, []);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = AndroidParser;
|
||||
|
||||
_defineProperty(AndroidParser, "timeRegex", /(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2}).\d{3}/m);
|
||||
|
||||
_defineProperty(AndroidParser, "headerRegex", /^\s*(\w)\/(.+)\(([\s\d]+)\):/);
|
||||
//# sourceMappingURL=AndroidParser.js.map
|
1
node_modules/logkitty/build/android/AndroidParser.js.map
generated
vendored
Normal file
1
node_modules/logkitty/build/android/AndroidParser.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
node_modules/logkitty/build/android/adb.d.ts
generated
vendored
Normal file
7
node_modules/logkitty/build/android/adb.d.ts
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
/// <reference types="node" />
|
||||
import { ChildProcess } from 'child_process';
|
||||
export declare function runAndroidLoggingProcess(adbPath?: string): ChildProcess;
|
||||
export declare function getAdbPath(customPath?: string): string;
|
||||
export declare function spawnLogcatProcess(adbPath: string): ChildProcess;
|
||||
export declare function getApplicationPid(applicationId: string, adbPath?: string): number;
|
||||
//# sourceMappingURL=adb.d.ts.map
|
1
node_modules/logkitty/build/android/adb.d.ts.map
generated
vendored
Normal file
1
node_modules/logkitty/build/android/adb.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"adb.d.ts","sourceRoot":"","sources":["../../src/android/adb.ts"],"names":[],"mappings":";AAAA,OAAO,EAAuB,YAAY,EAAE,MAAM,eAAe,CAAC;AAUlE,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,CAGvE;AAED,wBAAgB,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAQtD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAoBhE;AAED,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CAsBR"}
|
65
node_modules/logkitty/build/android/adb.js
generated
vendored
Normal file
65
node_modules/logkitty/build/android/adb.js
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.runAndroidLoggingProcess = runAndroidLoggingProcess;
|
||||
exports.getAdbPath = getAdbPath;
|
||||
exports.spawnLogcatProcess = spawnLogcatProcess;
|
||||
exports.getApplicationPid = getApplicationPid;
|
||||
|
||||
var _child_process = require("child_process");
|
||||
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
|
||||
var _errors = require("../errors");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function runAndroidLoggingProcess(adbPath) {
|
||||
const execPath = getAdbPath(adbPath);
|
||||
return spawnLogcatProcess(execPath);
|
||||
}
|
||||
|
||||
function getAdbPath(customPath) {
|
||||
if (customPath) {
|
||||
return _path.default.resolve(customPath);
|
||||
}
|
||||
|
||||
return process.env.ANDROID_HOME ? `${process.env.ANDROID_HOME}/platform-tools/adb` : 'adb';
|
||||
}
|
||||
|
||||
function spawnLogcatProcess(adbPath) {
|
||||
try {
|
||||
(0, _child_process.execFileSync)(adbPath, ['logcat', '-c']);
|
||||
} catch (error) {
|
||||
throw new _errors.CodeError(_errors.ERR_ANDROID_CANNOT_CLEAN_LOGCAT_BUFFER, error.message);
|
||||
}
|
||||
|
||||
try {
|
||||
return (0, _child_process.spawn)(adbPath, ['logcat', '-v', 'time', 'process', 'tag'], {
|
||||
stdio: 'pipe'
|
||||
});
|
||||
} catch (error) {
|
||||
throw new _errors.CodeError(_errors.ERR_ANDROID_CANNOT_START_LOGCAT, error.message);
|
||||
}
|
||||
}
|
||||
|
||||
function getApplicationPid(applicationId, adbPath) {
|
||||
let output;
|
||||
|
||||
try {
|
||||
output = (0, _child_process.execFileSync)(getAdbPath(adbPath), ['shell', 'pidof', '-s', applicationId]);
|
||||
} catch (error) {
|
||||
throw new _errors.CodeError(_errors.ERR_ANDROID_CANNOT_GET_APP_PID, error.message);
|
||||
}
|
||||
|
||||
const pid = output ? parseInt(output.toString(), 10) : NaN;
|
||||
|
||||
if (isNaN(pid)) {
|
||||
throw new _errors.CodeError(_errors.ERR_ANDROID_UNPROCESSABLE_PID);
|
||||
}
|
||||
|
||||
return pid;
|
||||
}
|
||||
//# sourceMappingURL=adb.js.map
|
1
node_modules/logkitty/build/android/adb.js.map
generated
vendored
Normal file
1
node_modules/logkitty/build/android/adb.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/android/adb.ts"],"names":["runAndroidLoggingProcess","adbPath","execPath","getAdbPath","spawnLogcatProcess","customPath","path","resolve","process","env","ANDROID_HOME","error","CodeError","ERR_ANDROID_CANNOT_CLEAN_LOGCAT_BUFFER","message","stdio","ERR_ANDROID_CANNOT_START_LOGCAT","getApplicationPid","applicationId","output","ERR_ANDROID_CANNOT_GET_APP_PID","pid","parseInt","toString","NaN","isNaN","ERR_ANDROID_UNPROCESSABLE_PID"],"mappings":";;;;;;;;;;AAAA;;AACA;;AACA;;;;AAQO,SAASA,wBAAT,CAAkCC,OAAlC,EAAkE;AACvE,QAAMC,QAAQ,GAAGC,UAAU,CAACF,OAAD,CAA3B;AACA,SAAOG,kBAAkB,CAACF,QAAD,CAAzB;AACD;;AAEM,SAASC,UAAT,CAAoBE,UAApB,EAAiD;AACtD,MAAIA,UAAJ,EAAgB;AACd,WAAOC,cAAKC,OAAL,CAAaF,UAAb,CAAP;AACD;;AAED,SAAOG,OAAO,CAACC,GAAR,CAAYC,YAAZ,GACF,GAAEF,OAAO,CAACC,GAAR,CAAYC,YAAa,qBADzB,GAEH,KAFJ;AAGD;;AAEM,SAASN,kBAAT,CAA4BH,OAA5B,EAA2D;AAChE,MAAI;AACF,qCAAaA,OAAb,EAAsB,CAAC,QAAD,EAAW,IAAX,CAAtB;AACD,GAFD,CAEE,OAAOU,KAAP,EAAc;AACd,UAAM,IAAIC,iBAAJ,CACJC,8CADI,EAEHF,KAAD,CAAiBG,OAFb,CAAN;AAID;;AAED,MAAI;AACF,WAAO,0BAAMb,OAAN,EAAe,CAAC,QAAD,EAAW,IAAX,EAAiB,MAAjB,EAAyB,SAAzB,EAAoC,KAApC,CAAf,EAA2D;AAChEc,MAAAA,KAAK,EAAE;AADyD,KAA3D,CAAP;AAGD,GAJD,CAIE,OAAOJ,KAAP,EAAc;AACd,UAAM,IAAIC,iBAAJ,CACJI,uCADI,EAEHL,KAAD,CAAiBG,OAFb,CAAN;AAID;AACF;;AAEM,SAASG,iBAAT,CACLC,aADK,EAELjB,OAFK,EAGG;AACR,MAAIkB,MAAJ;;AACA,MAAI;AACFA,IAAAA,MAAM,GAAG,iCAAahB,UAAU,CAACF,OAAD,CAAvB,EAAkC,CACzC,OADyC,EAEzC,OAFyC,EAGzC,IAHyC,EAIzCiB,aAJyC,CAAlC,CAAT;AAMD,GAPD,CAOE,OAAOP,KAAP,EAAc;AACd,UAAM,IAAIC,iBAAJ,CACJQ,sCADI,EAEHT,KAAD,CAAiBG,OAFb,CAAN;AAID;;AAED,QAAMO,GAAG,GAAGF,MAAM,GAAGG,QAAQ,CAACH,MAAM,CAACI,QAAP,EAAD,EAAoB,EAApB,CAAX,GAAqCC,GAAvD;;AACA,MAAIC,KAAK,CAACJ,GAAD,CAAT,EAAgB;AACd,UAAM,IAAIT,iBAAJ,CAAcc,qCAAd,CAAN;AACD;;AAED,SAAOL,GAAP;AACD","sourcesContent":["import { spawn, execFileSync, ChildProcess } from 'child_process';\nimport path from 'path';\nimport {\n CodeError,\n ERR_ANDROID_UNPROCESSABLE_PID,\n ERR_ANDROID_CANNOT_GET_APP_PID,\n ERR_ANDROID_CANNOT_CLEAN_LOGCAT_BUFFER,\n ERR_ANDROID_CANNOT_START_LOGCAT,\n} from '../errors';\n\nexport function runAndroidLoggingProcess(adbPath?: string): ChildProcess {\n const execPath = getAdbPath(adbPath);\n return spawnLogcatProcess(execPath);\n}\n\nexport function getAdbPath(customPath?: string): string {\n if (customPath) {\n return path.resolve(customPath);\n }\n\n return process.env.ANDROID_HOME\n ? `${process.env.ANDROID_HOME}/platform-tools/adb`\n : 'adb';\n}\n\nexport function spawnLogcatProcess(adbPath: string): ChildProcess {\n try {\n execFileSync(adbPath, ['logcat', '-c']);\n } catch (error) {\n throw new CodeError(\n ERR_ANDROID_CANNOT_CLEAN_LOGCAT_BUFFER,\n (error as Error).message\n );\n }\n\n try {\n return spawn(adbPath, ['logcat', '-v', 'time', 'process', 'tag'], {\n stdio: 'pipe',\n });\n } catch (error) {\n throw new CodeError(\n ERR_ANDROID_CANNOT_START_LOGCAT,\n (error as Error).message\n );\n }\n}\n\nexport function getApplicationPid(\n applicationId: string,\n adbPath?: string\n): number {\n let output: Buffer | String | undefined;\n try {\n output = execFileSync(getAdbPath(adbPath), [\n 'shell',\n 'pidof',\n '-s',\n applicationId,\n ]);\n } catch (error) {\n throw new CodeError(\n ERR_ANDROID_CANNOT_GET_APP_PID,\n (error as Error).message\n );\n }\n\n const pid = output ? parseInt(output.toString(), 10) : NaN;\n if (isNaN(pid)) {\n throw new CodeError(ERR_ANDROID_UNPROCESSABLE_PID);\n }\n\n return pid;\n}\n"],"file":"adb.js"}
|
27
node_modules/logkitty/build/android/constants.d.ts
generated
vendored
Normal file
27
node_modules/logkitty/build/android/constants.d.ts
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
declare const codes: {
|
||||
UNKNOWN: number;
|
||||
VERBOSE: number;
|
||||
DEBUG: number;
|
||||
INFO: number;
|
||||
WARN: number;
|
||||
ERROR: number;
|
||||
FATAL: number;
|
||||
SILENT: number;
|
||||
};
|
||||
export declare type PriorityNames = keyof typeof codes;
|
||||
export declare const Priority: {
|
||||
fromName(name: "UNKNOWN" | "VERBOSE" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "FATAL" | "SILENT"): number;
|
||||
toName(code: number): "UNKNOWN" | "VERBOSE" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "FATAL" | "SILENT";
|
||||
fromLetter(letter: string): number;
|
||||
toLetter(code: number): string;
|
||||
UNKNOWN: number;
|
||||
VERBOSE: number;
|
||||
DEBUG: number;
|
||||
INFO: number;
|
||||
WARN: number;
|
||||
ERROR: number;
|
||||
FATAL: number;
|
||||
SILENT: number;
|
||||
};
|
||||
export {};
|
||||
//# sourceMappingURL=constants.d.ts.map
|
1
node_modules/logkitty/build/android/constants.d.ts.map
generated
vendored
Normal file
1
node_modules/logkitty/build/android/constants.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/android/constants.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,KAAK;;;;;;;;;CASV,CAAC;AAEF,oBAAY,aAAa,GAAG,MAAM,OAAO,KAAK,CAAC;AAE/C,eAAO,MAAM,QAAQ;;;;;;;;;;;;;CAuBpB,CAAC"}
|
38
node_modules/logkitty/build/android/constants.js
generated
vendored
Normal file
38
node_modules/logkitty/build/android/constants.js
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.Priority = void 0;
|
||||
const codes = {
|
||||
UNKNOWN: 0,
|
||||
VERBOSE: 1,
|
||||
DEBUG: 2,
|
||||
INFO: 3,
|
||||
WARN: 4,
|
||||
ERROR: 5,
|
||||
FATAL: 6,
|
||||
SILENT: 7
|
||||
};
|
||||
const Priority = { ...codes,
|
||||
|
||||
fromName(name) {
|
||||
const value = codes[name.toUpperCase()];
|
||||
return value ? value : 0;
|
||||
},
|
||||
|
||||
toName(code) {
|
||||
return Object.keys(codes).find(key => codes[key] === code) || 'UNKNOWN';
|
||||
},
|
||||
|
||||
fromLetter(letter) {
|
||||
return codes[Object.keys(codes).find(key => key[0] === letter.toUpperCase()) || 'UNKNOWN'];
|
||||
},
|
||||
|
||||
toLetter(code) {
|
||||
return Priority.toName(code)[0];
|
||||
}
|
||||
|
||||
};
|
||||
exports.Priority = Priority;
|
||||
//# sourceMappingURL=constants.js.map
|
1
node_modules/logkitty/build/android/constants.js.map
generated
vendored
Normal file
1
node_modules/logkitty/build/android/constants.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/android/constants.ts"],"names":["codes","UNKNOWN","VERBOSE","DEBUG","INFO","WARN","ERROR","FATAL","SILENT","Priority","fromName","name","value","toUpperCase","toName","code","Object","keys","find","key","fromLetter","letter","toLetter"],"mappings":";;;;;;AAAA,MAAMA,KAAK,GAAG;AACZC,EAAAA,OAAO,EAAE,CADG;AAEZC,EAAAA,OAAO,EAAE,CAFG;AAGZC,EAAAA,KAAK,EAAE,CAHK;AAIZC,EAAAA,IAAI,EAAE,CAJM;AAKZC,EAAAA,IAAI,EAAE,CALM;AAMZC,EAAAA,KAAK,EAAE,CANK;AAOZC,EAAAA,KAAK,EAAE,CAPK;AAQZC,EAAAA,MAAM,EAAE;AARI,CAAd;AAaO,MAAMC,QAAQ,GAAG,EACtB,GAAGT,KADmB;;AAEtBU,EAAAA,QAAQ,CAACC,IAAD,EAA8B;AACpC,UAAMC,KAAK,GAAGZ,KAAK,CAACW,IAAI,CAACE,WAAL,EAAD,CAAnB;AACA,WAAOD,KAAK,GAAGA,KAAH,GAAW,CAAvB;AACD,GALqB;;AAMtBE,EAAAA,MAAM,CAACC,IAAD,EAA8B;AAClC,WACGC,MAAM,CAACC,IAAP,CAAYjB,KAAZ,CAAD,CAAwCkB,IAAxC,CACGC,GAAD,IAAwBnB,KAAK,CAACmB,GAAD,CAAL,KAAeJ,IADzC,KAEK,SAHP;AAKD,GAZqB;;AAatBK,EAAAA,UAAU,CAACC,MAAD,EAAyB;AACjC,WAAOrB,KAAK,CACTgB,MAAM,CAACC,IAAP,CAAYjB,KAAZ,CAAD,CAAwCkB,IAAxC,CACGC,GAAD,IAAwBA,GAAG,CAAC,CAAD,CAAH,KAAWE,MAAM,CAACR,WAAP,EADrC,KAEK,SAHK,CAAZ;AAKD,GAnBqB;;AAoBtBS,EAAAA,QAAQ,CAACP,IAAD,EAAuB;AAC7B,WAAON,QAAQ,CAACK,MAAT,CAAgBC,IAAhB,EAAsB,CAAtB,CAAP;AACD;;AAtBqB,CAAjB","sourcesContent":["const codes = {\n UNKNOWN: 0,\n VERBOSE: 1,\n DEBUG: 2,\n INFO: 3,\n WARN: 4,\n ERROR: 5,\n FATAL: 6,\n SILENT: 7,\n};\n\nexport type PriorityNames = keyof typeof codes;\n\nexport const Priority = {\n ...codes,\n fromName(name: PriorityNames): number {\n const value = codes[name.toUpperCase() as PriorityNames];\n return value ? value : 0;\n },\n toName(code: number): PriorityNames {\n return (\n (Object.keys(codes) as PriorityNames[]).find(\n (key: PriorityNames) => codes[key] === code\n ) || 'UNKNOWN'\n );\n },\n fromLetter(letter: string): number {\n return codes[\n (Object.keys(codes) as PriorityNames[]).find(\n (key: PriorityNames) => key[0] === letter.toUpperCase()\n ) || 'UNKNOWN'\n ];\n },\n toLetter(code: number): string {\n return Priority.toName(code)[0];\n },\n};\n"],"file":"constants.js"}
|
20
node_modules/logkitty/build/api.d.ts
generated
vendored
Normal file
20
node_modules/logkitty/build/api.d.ts
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/// <reference types="node" />
|
||||
import { EventEmitter } from 'events';
|
||||
import { IFilter, Platform } from './types';
|
||||
export { Priority as AndroidPriority } from './android/constants';
|
||||
export { Priority as IosPriority } from './ios/constants';
|
||||
export { formatEntry, formatError } from './formatters';
|
||||
export { Entry } from './types';
|
||||
export declare type LogkittyOptions = {
|
||||
platform: Platform;
|
||||
adbPath?: string;
|
||||
priority?: number;
|
||||
filter?: FilterCreator;
|
||||
};
|
||||
export declare type FilterCreator = (platform: Platform, minPriority?: number, adbPath?: string) => IFilter;
|
||||
export declare function makeTagsFilter(...tags: string[]): FilterCreator;
|
||||
export declare function makeAppFilter(appIdentifier: string): FilterCreator;
|
||||
export declare function makeMatchFilter(...regexes: RegExp[]): FilterCreator;
|
||||
export declare function makeCustomFilter(...patterns: string[]): FilterCreator;
|
||||
export declare function logkitty(options: LogkittyOptions): EventEmitter;
|
||||
//# sourceMappingURL=api.d.ts.map
|
1
node_modules/logkitty/build/api.d.ts.map
generated
vendored
Normal file
1
node_modules/logkitty/build/api.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,OAAO,EAAS,QAAQ,EAAE,MAAM,SAAS,CAAC;AAMnD,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAOlE,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,oBAAY,eAAe,GAAG;IAC5B,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB,CAAC;AAEF,oBAAY,aAAa,GAAG,CAC1B,QAAQ,EAAE,QAAQ,EAClB,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,MAAM,KACb,OAAO,CAAC;AAEb,wBAAgB,cAAc,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,aAAa,CAS/D;AAED,wBAAgB,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,CAUlE;AAED,wBAAgB,eAAe,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,aAAa,CASnE;AAED,wBAAgB,gBAAgB,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,aAAa,CAUrE;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,YAAY,CAwE/D"}
|
174
node_modules/logkitty/build/api.js
generated
vendored
Normal file
174
node_modules/logkitty/build/api.js
generated
vendored
Normal file
@ -0,0 +1,174 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.makeTagsFilter = makeTagsFilter;
|
||||
exports.makeAppFilter = makeAppFilter;
|
||||
exports.makeMatchFilter = makeMatchFilter;
|
||||
exports.makeCustomFilter = makeCustomFilter;
|
||||
exports.logkitty = logkitty;
|
||||
Object.defineProperty(exports, "Entry", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _types.Entry;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "AndroidPriority", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _constants.Priority;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "IosPriority", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _constants2.Priority;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "formatEntry", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _formatters.formatEntry;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "formatError", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _formatters.formatError;
|
||||
}
|
||||
});
|
||||
|
||||
var _events = require("events");
|
||||
|
||||
var _types = require("./types");
|
||||
|
||||
var _AndroidFilter = _interopRequireDefault(require("./android/AndroidFilter"));
|
||||
|
||||
var _AndroidParser = _interopRequireDefault(require("./android/AndroidParser"));
|
||||
|
||||
var _adb = require("./android/adb");
|
||||
|
||||
var _constants = require("./android/constants");
|
||||
|
||||
var _IosParser = _interopRequireDefault(require("./ios/IosParser"));
|
||||
|
||||
var _IosFilter = _interopRequireDefault(require("./ios/IosFilter"));
|
||||
|
||||
var _simulator = require("./ios/simulator");
|
||||
|
||||
var _errors = require("./errors");
|
||||
|
||||
var _constants2 = require("./ios/constants");
|
||||
|
||||
var _formatters = require("./formatters");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/* Common */
|
||||
|
||||
/* Android */
|
||||
|
||||
/* iOS */
|
||||
|
||||
/* Exports */
|
||||
function makeTagsFilter(...tags) {
|
||||
return (platform, minPriority) => {
|
||||
const filter = platform === 'android' ? new _AndroidFilter.default(minPriority) : new _IosFilter.default(minPriority);
|
||||
filter.setFilterByTag(tags);
|
||||
return filter;
|
||||
};
|
||||
}
|
||||
|
||||
function makeAppFilter(appIdentifier) {
|
||||
return (platform, minPriority, adbPath) => {
|
||||
if (platform !== 'android') {
|
||||
throw new Error('App filter is only available for Android');
|
||||
}
|
||||
|
||||
const filter = new _AndroidFilter.default(minPriority);
|
||||
filter.setFilterByApp(appIdentifier, adbPath);
|
||||
return filter;
|
||||
};
|
||||
}
|
||||
|
||||
function makeMatchFilter(...regexes) {
|
||||
return (platform, minPriority) => {
|
||||
const filter = platform === 'android' ? new _AndroidFilter.default(minPriority) : new _IosFilter.default(minPriority);
|
||||
filter.setFilterByMatch(regexes);
|
||||
return filter;
|
||||
};
|
||||
}
|
||||
|
||||
function makeCustomFilter(...patterns) {
|
||||
return (platform, minPriority) => {
|
||||
if (platform !== 'android') {
|
||||
throw new Error('Custom filter is only available for Android');
|
||||
}
|
||||
|
||||
const filter = new _AndroidFilter.default(minPriority);
|
||||
filter.setCustomFilter(patterns);
|
||||
return filter;
|
||||
};
|
||||
}
|
||||
|
||||
function logkitty(options) {
|
||||
const {
|
||||
platform,
|
||||
adbPath,
|
||||
priority,
|
||||
filter: createFilter
|
||||
} = options;
|
||||
const emitter = new _events.EventEmitter();
|
||||
|
||||
if (!['ios', 'android'].some(availablePlatform => availablePlatform === platform)) {
|
||||
throw new Error(`Platform ${platform} is not supported`);
|
||||
}
|
||||
|
||||
const parser = platform === 'android' ? new _AndroidParser.default() : new _IosParser.default();
|
||||
let filter;
|
||||
|
||||
if (createFilter) {
|
||||
filter = createFilter(platform, priority, adbPath);
|
||||
} else {
|
||||
filter = platform === 'android' ? new _AndroidFilter.default(priority) : new _IosFilter.default(priority);
|
||||
}
|
||||
|
||||
const loggingProcess = platform === 'android' ? (0, _adb.runAndroidLoggingProcess)(adbPath) : (0, _simulator.runSimulatorLoggingProcess)();
|
||||
process.on('exit', () => {
|
||||
loggingProcess.kill();
|
||||
emitter.emit('exit');
|
||||
});
|
||||
loggingProcess.stderr.on('data', errorData => {
|
||||
if (platform === 'ios' && errorData.toString().includes('No devices are booted.')) {
|
||||
emitter.emit('error', new _errors.CodeError(_errors.ERR_IOS_NO_SIMULATORS_BOOTED, 'No simulators are booted.'));
|
||||
} else {
|
||||
emitter.emit('error', new Error(errorData.toString()));
|
||||
}
|
||||
});
|
||||
loggingProcess.stdout.on('data', raw => {
|
||||
let entryToLog;
|
||||
|
||||
try {
|
||||
const messages = parser.splitMessages(raw.toString());
|
||||
const entries = parser.parseMessages(messages);
|
||||
entries.forEach(entry => {
|
||||
if (filter.shouldInclude(entry)) {
|
||||
entryToLog = entry;
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
emitter.emit('error', error);
|
||||
}
|
||||
|
||||
if (entryToLog) {
|
||||
emitter.emit('entry', entryToLog);
|
||||
}
|
||||
});
|
||||
loggingProcess.stdout.on('error', error => {
|
||||
emitter.emit('error', error);
|
||||
emitter.emit('exit');
|
||||
});
|
||||
return emitter;
|
||||
}
|
||||
//# sourceMappingURL=api.js.map
|
1
node_modules/logkitty/build/api.js.map
generated
vendored
Normal file
1
node_modules/logkitty/build/api.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
node_modules/logkitty/build/cli.d.ts
generated
vendored
Normal file
2
node_modules/logkitty/build/cli.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=cli.d.ts.map
|
1
node_modules/logkitty/build/cli.d.ts.map
generated
vendored
Normal file
1
node_modules/logkitty/build/cli.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
156
node_modules/logkitty/build/cli.js
generated
vendored
Normal file
156
node_modules/logkitty/build/cli.js
generated
vendored
Normal file
@ -0,0 +1,156 @@
|
||||
"use strict";
|
||||
|
||||
var _yargs = _interopRequireDefault(require("yargs"));
|
||||
|
||||
var _api = require("./api");
|
||||
|
||||
var _formatters = require("./formatters");
|
||||
|
||||
var _utils = require("./utils");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const androidPriorityOptions = {
|
||||
unknown: {
|
||||
alias: ['U', 'u'],
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: 'Unknown priority'
|
||||
},
|
||||
verbose: {
|
||||
alias: ['V', 'v'],
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: 'Verbose priority'
|
||||
},
|
||||
debug: {
|
||||
alias: ['D', 'd'],
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: 'Debug priority'
|
||||
},
|
||||
info: {
|
||||
alias: ['I', 'i'],
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: 'Info priority'
|
||||
},
|
||||
warn: {
|
||||
alias: ['W', 'w'],
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: 'Warn priority'
|
||||
},
|
||||
error: {
|
||||
alias: ['E', 'e'],
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: 'Error priority'
|
||||
},
|
||||
fatal: {
|
||||
alias: ['F', 'f'],
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: 'Fatal priority'
|
||||
},
|
||||
silent: {
|
||||
alias: ['S', 's'],
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: 'Silent priority'
|
||||
}
|
||||
};
|
||||
const iosPriorityOptions = {
|
||||
debug: {
|
||||
alias: ['D', 'd'],
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: 'Debug level'
|
||||
},
|
||||
info: {
|
||||
alias: ['I', 'i'],
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: 'Info level'
|
||||
},
|
||||
error: {
|
||||
alias: ['E', 'e'],
|
||||
boolean: true,
|
||||
default: false,
|
||||
describe: 'Error level'
|
||||
}
|
||||
};
|
||||
|
||||
const {
|
||||
argv: {
|
||||
_: [platform, filter],
|
||||
...args
|
||||
}
|
||||
} = _yargs.default.usage('Usage: $0 [options] <platform>').command('android', 'Android', yargs => yargs.command('tag <tags ...>', 'Show logs matching given tags', androidPriorityOptions).command('app <appId>', 'Show logs from application with given identifier', androidPriorityOptions).command('match <regexes...>', 'Show logs matching given patterns', androidPriorityOptions).command('custom <patterns ...>', 'Filter using custom patterns <tag>:<priority>').command('all', 'Show all logs', androidPriorityOptions).demandCommand(1).option('adb-path', {
|
||||
type: 'string',
|
||||
describe: 'Use custom path to adb',
|
||||
nargs: 1
|
||||
}).example('$0 android tag MyTag', 'Filter logs to only include ones with MyTag tag').example('$0 android tag MyTag -I', 'Filter logs to only include ones with MyTag tag and priority INFO and above').example('$0 android app com.example.myApp', 'Show all logs from com.example.myApp').example('$0 android match device', 'Show all logs matching /device/gm regex').example('$0 android app com.example.myApp -E', 'Show all logs from com.example.myApp with priority ERROR and above').example('$0 android custom *:S MyTag:D', 'Silence all logs and show only ones with MyTag with priority DEBUG and above')).command('ios <filter>', 'iOS', yargs => yargs.command('tag <tags ...>', 'Show logs matching given tags', iosPriorityOptions).command('match <regexes...>', 'Show logs matching given patterns', iosPriorityOptions).command('all', 'Show all logs', iosPriorityOptions).demandCommand(1).example('$0 ios tag MyTag', 'Filter logs to only include ones with MyTag tag').example('$0 ios tag MyTag -i', 'Filter logs to only include ones with MyTag tag and priority Info and Error').example('$0 ios match device', 'Show all logs matching /device/gm regex')).demandCommand(1).help('h').alias('h', 'help').alias('v', 'version').version();
|
||||
|
||||
const selectedAndroidPriorities = {
|
||||
unknown: Boolean(args.unknown),
|
||||
verbose: Boolean(args.verbose),
|
||||
debug: Boolean(args.debug),
|
||||
info: Boolean(args.info),
|
||||
warn: Boolean(args.warn),
|
||||
error: Boolean(args.error),
|
||||
fatal: Boolean(args.fatal),
|
||||
silent: Boolean(args.silent)
|
||||
};
|
||||
const selectedIosPriorities = {
|
||||
debug: Boolean(args.debug),
|
||||
info: Boolean(args.info),
|
||||
error: Boolean(args.error)
|
||||
};
|
||||
|
||||
try {
|
||||
let createFilter;
|
||||
|
||||
switch (filter) {
|
||||
case 'app':
|
||||
createFilter = (0, _api.makeAppFilter)(args.appId);
|
||||
break;
|
||||
|
||||
case 'tag':
|
||||
createFilter = (0, _api.makeTagsFilter)(...args.tags);
|
||||
break;
|
||||
|
||||
case 'match':
|
||||
createFilter = (0, _api.makeMatchFilter)(...args.regexes.map(value => new RegExp(value, 'gm')));
|
||||
break;
|
||||
|
||||
case 'custom':
|
||||
createFilter = (0, _api.makeCustomFilter)(...args.patterns);
|
||||
break;
|
||||
|
||||
case 'all':
|
||||
default:
|
||||
}
|
||||
|
||||
const emitter = (0, _api.logkitty)({
|
||||
platform: platform,
|
||||
adbPath: args.adbPath ? String(args.adbPath) : '',
|
||||
priority: platform === 'android' ? (0, _utils.getMinPriority)(_api.AndroidPriority, selectedAndroidPriorities, _api.AndroidPriority.DEBUG) : (0, _utils.getMinPriority)(_api.IosPriority, selectedIosPriorities, _api.IosPriority.DEFAULT),
|
||||
filter: createFilter
|
||||
});
|
||||
emitter.on('entry', entry => {
|
||||
process.stdout.write((0, _formatters.formatEntry)(entry));
|
||||
});
|
||||
emitter.on('error', error => {
|
||||
terminate(error);
|
||||
});
|
||||
} catch (error) {
|
||||
terminate(error);
|
||||
}
|
||||
|
||||
function terminate(error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log((0, _formatters.formatError)(error));
|
||||
process.exit(1);
|
||||
}
|
||||
//# sourceMappingURL=cli.js.map
|
1
node_modules/logkitty/build/cli.js.map
generated
vendored
Normal file
1
node_modules/logkitty/build/cli.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
12
node_modules/logkitty/build/errors.d.ts
generated
vendored
Normal file
12
node_modules/logkitty/build/errors.d.ts
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
export declare class CodeError extends Error {
|
||||
code: string;
|
||||
constructor(code: string, message?: string);
|
||||
}
|
||||
export declare const ERR_ANDROID_UNPROCESSABLE_PID = "ERR_ANDROID_UNPROCESSABLE_PID";
|
||||
export declare const ERR_ANDROID_CANNOT_GET_APP_PID = "ERR_ANDROID_CANNOT_GET_APP_PID";
|
||||
export declare const ERR_ANDROID_CANNOT_CLEAN_LOGCAT_BUFFER = "ERR_ANDROID_CANNOT_CLEAN_LOGCAT_BUFFER";
|
||||
export declare const ERR_ANDROID_CANNOT_START_LOGCAT = "ERR_ANDROID_CANNOT_START_LOGCAT";
|
||||
export declare const ERR_IOS_CANNOT_LIST_SIMULATORS = "ERR_IOS_CANNOT_LIST_SIMULATORS";
|
||||
export declare const ERR_IOS_NO_SIMULATORS_BOOTED = "ERR_IOS_NO_SIMULATORS_BOOTED";
|
||||
export declare const ERR_IOS_CANNOT_START_SYSLOG = "ERR_IOS_CANNOT_START_SYSLOG";
|
||||
//# sourceMappingURL=errors.d.ts.map
|
1
node_modules/logkitty/build/errors.d.ts.map
generated
vendored
Normal file
1
node_modules/logkitty/build/errors.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAU,SAAQ,KAAK;IAClC,IAAI,EAAE,MAAM,CAAC;gBAED,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAI3C;AAED,eAAO,MAAM,6BAA6B,kCAAkC,CAAC;AAC7E,eAAO,MAAM,8BAA8B,mCAAmC,CAAC;AAC/E,eAAO,MAAM,sCAAsC,2CACT,CAAC;AAC3C,eAAO,MAAM,+BAA+B,oCACT,CAAC;AAEpC,eAAO,MAAM,8BAA8B,mCAAmC,CAAC;AAC/E,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAC3E,eAAO,MAAM,2BAA2B,gCAAgC,CAAC"}
|
36
node_modules/logkitty/build/errors.js
generated
vendored
Normal file
36
node_modules/logkitty/build/errors.js
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.ERR_IOS_CANNOT_START_SYSLOG = exports.ERR_IOS_NO_SIMULATORS_BOOTED = exports.ERR_IOS_CANNOT_LIST_SIMULATORS = exports.ERR_ANDROID_CANNOT_START_LOGCAT = exports.ERR_ANDROID_CANNOT_CLEAN_LOGCAT_BUFFER = exports.ERR_ANDROID_CANNOT_GET_APP_PID = exports.ERR_ANDROID_UNPROCESSABLE_PID = exports.CodeError = void 0;
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
class CodeError extends Error {
|
||||
constructor(code, message) {
|
||||
super(message);
|
||||
|
||||
_defineProperty(this, "code", void 0);
|
||||
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.CodeError = CodeError;
|
||||
const ERR_ANDROID_UNPROCESSABLE_PID = 'ERR_ANDROID_UNPROCESSABLE_PID';
|
||||
exports.ERR_ANDROID_UNPROCESSABLE_PID = ERR_ANDROID_UNPROCESSABLE_PID;
|
||||
const ERR_ANDROID_CANNOT_GET_APP_PID = 'ERR_ANDROID_CANNOT_GET_APP_PID';
|
||||
exports.ERR_ANDROID_CANNOT_GET_APP_PID = ERR_ANDROID_CANNOT_GET_APP_PID;
|
||||
const ERR_ANDROID_CANNOT_CLEAN_LOGCAT_BUFFER = 'ERR_ANDROID_CANNOT_CLEAN_LOGCAT_BUFFER';
|
||||
exports.ERR_ANDROID_CANNOT_CLEAN_LOGCAT_BUFFER = ERR_ANDROID_CANNOT_CLEAN_LOGCAT_BUFFER;
|
||||
const ERR_ANDROID_CANNOT_START_LOGCAT = 'ERR_ANDROID_CANNOT_START_LOGCAT';
|
||||
exports.ERR_ANDROID_CANNOT_START_LOGCAT = ERR_ANDROID_CANNOT_START_LOGCAT;
|
||||
const ERR_IOS_CANNOT_LIST_SIMULATORS = 'ERR_IOS_CANNOT_LIST_SIMULATORS';
|
||||
exports.ERR_IOS_CANNOT_LIST_SIMULATORS = ERR_IOS_CANNOT_LIST_SIMULATORS;
|
||||
const ERR_IOS_NO_SIMULATORS_BOOTED = 'ERR_IOS_NO_SIMULATORS_BOOTED';
|
||||
exports.ERR_IOS_NO_SIMULATORS_BOOTED = ERR_IOS_NO_SIMULATORS_BOOTED;
|
||||
const ERR_IOS_CANNOT_START_SYSLOG = 'ERR_IOS_CANNOT_START_SYSLOG';
|
||||
exports.ERR_IOS_CANNOT_START_SYSLOG = ERR_IOS_CANNOT_START_SYSLOG;
|
||||
//# sourceMappingURL=errors.js.map
|
1
node_modules/logkitty/build/errors.js.map
generated
vendored
Normal file
1
node_modules/logkitty/build/errors.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../src/errors.ts"],"names":["CodeError","Error","constructor","code","message","ERR_ANDROID_UNPROCESSABLE_PID","ERR_ANDROID_CANNOT_GET_APP_PID","ERR_ANDROID_CANNOT_CLEAN_LOGCAT_BUFFER","ERR_ANDROID_CANNOT_START_LOGCAT","ERR_IOS_CANNOT_LIST_SIMULATORS","ERR_IOS_NO_SIMULATORS_BOOTED","ERR_IOS_CANNOT_START_SYSLOG"],"mappings":";;;;;;;;;AAAO,MAAMA,SAAN,SAAwBC,KAAxB,CAA8B;AAGnCC,EAAAA,WAAW,CAACC,IAAD,EAAeC,OAAf,EAAiC;AAC1C,UAAMA,OAAN;;AAD0C;;AAE1C,SAAKD,IAAL,GAAYA,IAAZ;AACD;;AANkC;;;AAS9B,MAAME,6BAA6B,GAAG,+BAAtC;;AACA,MAAMC,8BAA8B,GAAG,gCAAvC;;AACA,MAAMC,sCAAsC,GACjD,wCADK;;AAEA,MAAMC,+BAA+B,GAC1C,iCADK;;AAGA,MAAMC,8BAA8B,GAAG,gCAAvC;;AACA,MAAMC,4BAA4B,GAAG,8BAArC;;AACA,MAAMC,2BAA2B,GAAG,6BAApC","sourcesContent":["export class CodeError extends Error {\n code: string;\n\n constructor(code: string, message?: string) {\n super(message);\n this.code = code;\n }\n}\n\nexport const ERR_ANDROID_UNPROCESSABLE_PID = 'ERR_ANDROID_UNPROCESSABLE_PID';\nexport const ERR_ANDROID_CANNOT_GET_APP_PID = 'ERR_ANDROID_CANNOT_GET_APP_PID';\nexport const ERR_ANDROID_CANNOT_CLEAN_LOGCAT_BUFFER =\n 'ERR_ANDROID_CANNOT_CLEAN_LOGCAT_BUFFER';\nexport const ERR_ANDROID_CANNOT_START_LOGCAT =\n 'ERR_ANDROID_CANNOT_START_LOGCAT';\n\nexport const ERR_IOS_CANNOT_LIST_SIMULATORS = 'ERR_IOS_CANNOT_LIST_SIMULATORS';\nexport const ERR_IOS_NO_SIMULATORS_BOOTED = 'ERR_IOS_NO_SIMULATORS_BOOTED';\nexport const ERR_IOS_CANNOT_START_SYSLOG = 'ERR_IOS_CANNOT_START_SYSLOG';\n"],"file":"errors.js"}
|
5
node_modules/logkitty/build/formatters.d.ts
generated
vendored
Normal file
5
node_modules/logkitty/build/formatters.d.ts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import { CodeError } from './errors';
|
||||
import { Entry } from './types';
|
||||
export declare function formatError(error: CodeError | Error): string;
|
||||
export declare function formatEntry(entry: Entry): string;
|
||||
//# sourceMappingURL=formatters.d.ts.map
|
1
node_modules/logkitty/build/formatters.d.ts.map
generated
vendored
Normal file
1
node_modules/logkitty/build/formatters.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../src/formatters.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM,CAU5D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAyEhD"}
|
34
node_modules/logkitty/build/formatters.js
generated
vendored
Normal file
34
node_modules/logkitty/build/formatters.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.formatError = formatError;
|
||||
exports.formatEntry = formatEntry;
|
||||
|
||||
var _ansiFragments = require("ansi-fragments");
|
||||
|
||||
var _constants = require("./android/constants");
|
||||
|
||||
var _constants2 = require("./ios/constants");
|
||||
|
||||
function formatError(error) {
|
||||
return (0, _ansiFragments.container)((0, _ansiFragments.color)('red', '✖︎ Ups, something went wrong'), (0, _ansiFragments.pad)(2, '\n'), (0, _ansiFragments.color)('red', (0, _ansiFragments.modifier)('bold', 'CODE'), ' ▶︎ '), 'code' in error ? error.code : 'ERR_UNKNOWN', (0, _ansiFragments.pad)(1, '\n'), (0, _ansiFragments.color)('red', (0, _ansiFragments.modifier)('bold', 'MESSAGE'), ' ▶︎ '), error.message).build();
|
||||
}
|
||||
|
||||
function formatEntry(entry) {
|
||||
let priorityColor = 'none';
|
||||
let priorityModifier = 'none';
|
||||
|
||||
if (entry.platform === 'android' && entry.priority >= _constants.Priority.ERROR || entry.platform === 'ios' && entry.priority >= _constants2.Priority.ERROR) {
|
||||
priorityColor = 'red';
|
||||
} else if (entry.platform === 'android' && entry.priority === _constants.Priority.WARN) {
|
||||
priorityColor = 'yellow';
|
||||
} else if (entry.platform === 'android' && entry.priority === _constants.Priority.VERBOSE || entry.platform === 'ios' && entry.priority === _constants2.Priority.DEBUG) {
|
||||
priorityModifier = 'dim';
|
||||
}
|
||||
|
||||
const output = (0, _ansiFragments.container)((0, _ansiFragments.modifier)('dim', `[${entry.date.format('HH:mm:ss')}]`), (0, _ansiFragments.pad)(1), (0, _ansiFragments.color)(priorityColor, (0, _ansiFragments.modifier)(priorityModifier, `${entry.platform === 'android' ? _constants.Priority.toLetter(entry.priority) : _constants2.Priority.toLetter(entry.priority)} |`)), (0, _ansiFragments.pad)(1), (0, _ansiFragments.modifier)('bold', (0, _ansiFragments.color)(priorityColor, (0, _ansiFragments.modifier)(priorityModifier, entry.tag || entry.appId || ''))), (0, _ansiFragments.pad)(1), (0, _ansiFragments.color)(priorityColor, (0, _ansiFragments.modifier)(priorityModifier, '▶︎')), (0, _ansiFragments.pad)(1), (0, _ansiFragments.color)(priorityColor, (0, _ansiFragments.modifier)(priorityModifier, entry.messages[0])), (0, _ansiFragments.ifElse)(entry.messages.length > 1, (0, _ansiFragments.container)(...entry.messages.slice(1).map((line, index, arr) => (0, _ansiFragments.container)((0, _ansiFragments.pad)(1, '\n'), (0, _ansiFragments.pad)((entry.tag || entry.appId || '').length + 16), (0, _ansiFragments.color)(priorityColor, (0, _ansiFragments.modifier)(priorityColor === 'none' ? 'dim' : 'none', `${index === arr.length - 1 ? '└' : '│'} `)), (0, _ansiFragments.color)(priorityColor, (0, _ansiFragments.modifier)(priorityModifier, line))))), '')).build();
|
||||
return `${output}\n`;
|
||||
}
|
||||
//# sourceMappingURL=formatters.js.map
|
1
node_modules/logkitty/build/formatters.js.map
generated
vendored
Normal file
1
node_modules/logkitty/build/formatters.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
10
node_modules/logkitty/build/ios/IosFilter.d.ts
generated
vendored
Normal file
10
node_modules/logkitty/build/ios/IosFilter.d.ts
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
import { IFilter, Entry } from '../types';
|
||||
export default class IosFilter implements IFilter {
|
||||
private readonly minPriority;
|
||||
private filter;
|
||||
constructor(minPriority?: number);
|
||||
setFilterByTag(tags: string[]): void;
|
||||
setFilterByMatch(regexes: RegExp[]): void;
|
||||
shouldInclude(entry: Entry): boolean;
|
||||
}
|
||||
//# sourceMappingURL=IosFilter.d.ts.map
|
1
node_modules/logkitty/build/ios/IosFilter.d.ts.map
generated
vendored
Normal file
1
node_modules/logkitty/build/ios/IosFilter.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"IosFilter.d.ts","sourceRoot":"","sources":["../../src/ios/IosFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAI1C,MAAM,CAAC,OAAO,OAAO,SAAU,YAAW,OAAO;IAC/C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,MAAM,CAAS;gBAEX,WAAW,GAAE,MAAU;IAQnC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE;IAU7B,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE;IAalC,aAAa,CAAC,KAAK,EAAE,KAAK;CAG3B"}
|
42
node_modules/logkitty/build/ios/IosFilter.js
generated
vendored
Normal file
42
node_modules/logkitty/build/ios/IosFilter.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
class IosFilter {
|
||||
constructor(minPriority = 0) {
|
||||
_defineProperty(this, "minPriority", void 0);
|
||||
|
||||
_defineProperty(this, "filter", void 0);
|
||||
|
||||
this.minPriority = minPriority; // Default filter by all
|
||||
|
||||
this.filter = entry => {
|
||||
return entry.priority >= this.minPriority;
|
||||
};
|
||||
}
|
||||
|
||||
setFilterByTag(tags) {
|
||||
this.filter = entry => {
|
||||
return Boolean(entry.priority >= this.minPriority && entry.tag && tags.indexOf(entry.tag) > -1);
|
||||
};
|
||||
}
|
||||
|
||||
setFilterByMatch(regexes) {
|
||||
this.filter = entry => {
|
||||
return entry.priority >= this.minPriority && Boolean(regexes.find(reg => Boolean(entry.messages.find(message => reg.test(message)))));
|
||||
};
|
||||
}
|
||||
|
||||
shouldInclude(entry) {
|
||||
return this.filter(entry);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = IosFilter;
|
||||
//# sourceMappingURL=IosFilter.js.map
|
1
node_modules/logkitty/build/ios/IosFilter.js.map
generated
vendored
Normal file
1
node_modules/logkitty/build/ios/IosFilter.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/ios/IosFilter.ts"],"names":["IosFilter","constructor","minPriority","filter","entry","priority","setFilterByTag","tags","Boolean","tag","indexOf","setFilterByMatch","regexes","find","reg","messages","message","test","shouldInclude"],"mappings":";;;;;;;;;AAIe,MAAMA,SAAN,CAAmC;AAIhDC,EAAAA,WAAW,CAACC,WAAmB,GAAG,CAAvB,EAA0B;AAAA;;AAAA;;AACnC,SAAKA,WAAL,GAAmBA,WAAnB,CADmC,CAEnC;;AACA,SAAKC,MAAL,GAAeC,KAAD,IAAkB;AAC9B,aAAOA,KAAK,CAACC,QAAN,IAAkB,KAAKH,WAA9B;AACD,KAFD;AAGD;;AAEDI,EAAAA,cAAc,CAACC,IAAD,EAAiB;AAC7B,SAAKJ,MAAL,GAAeC,KAAD,IAAkB;AAC9B,aAAOI,OAAO,CACZJ,KAAK,CAACC,QAAN,IAAkB,KAAKH,WAAvB,IACEE,KAAK,CAACK,GADR,IAEEF,IAAI,CAACG,OAAL,CAAaN,KAAK,CAACK,GAAnB,IAA0B,CAAC,CAHjB,CAAd;AAKD,KAND;AAOD;;AAEDE,EAAAA,gBAAgB,CAACC,OAAD,EAAoB;AAClC,SAAKT,MAAL,GAAeC,KAAD,IAAkB;AAC9B,aACEA,KAAK,CAACC,QAAN,IAAkB,KAAKH,WAAvB,IACAM,OAAO,CACLI,OAAO,CAACC,IAAR,CAAcC,GAAD,IACXN,OAAO,CAACJ,KAAK,CAACW,QAAN,CAAeF,IAAf,CAAqBG,OAAD,IAAqBF,GAAG,CAACG,IAAJ,CAASD,OAAT,CAAzC,CAAD,CADT,CADK,CAFT;AAQD,KATD;AAUD;;AAEDE,EAAAA,aAAa,CAACd,KAAD,EAAe;AAC1B,WAAO,KAAKD,MAAL,CAAYC,KAAZ,CAAP;AACD;;AArC+C","sourcesContent":["import { IFilter, Entry } from '../types';\n\ntype Filter = (entry: Entry) => boolean;\n\nexport default class IosFilter implements IFilter {\n private readonly minPriority: number;\n private filter: Filter;\n\n constructor(minPriority: number = 0) {\n this.minPriority = minPriority;\n // Default filter by all\n this.filter = (entry: Entry) => {\n return entry.priority >= this.minPriority;\n };\n }\n\n setFilterByTag(tags: string[]) {\n this.filter = (entry: Entry) => {\n return Boolean(\n entry.priority >= this.minPriority &&\n entry.tag &&\n tags.indexOf(entry.tag) > -1\n );\n };\n }\n\n setFilterByMatch(regexes: RegExp[]) {\n this.filter = (entry: Entry) => {\n return (\n entry.priority >= this.minPriority &&\n Boolean(\n regexes.find((reg: RegExp) =>\n Boolean(entry.messages.find((message: string) => reg.test(message)))\n )\n )\n );\n };\n }\n\n shouldInclude(entry: Entry) {\n return this.filter(entry);\n }\n}\n"],"file":"IosFilter.js"}
|
8
node_modules/logkitty/build/ios/IosParser.d.ts
generated
vendored
Normal file
8
node_modules/logkitty/build/ios/IosParser.d.ts
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import { IParser, Entry } from '../types';
|
||||
export default class IosParser implements IParser {
|
||||
static timeRegex: RegExp;
|
||||
static headerRegex: RegExp;
|
||||
splitMessages(raw: string): string[];
|
||||
parseMessages(messages: string[]): Entry[];
|
||||
}
|
||||
//# sourceMappingURL=IosParser.d.ts.map
|
1
node_modules/logkitty/build/ios/IosParser.d.ts.map
generated
vendored
Normal file
1
node_modules/logkitty/build/ios/IosParser.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"IosParser.d.ts","sourceRoot":"","sources":["../../src/ios/IosParser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAG1C,MAAM,CAAC,OAAO,OAAO,SAAU,YAAW,OAAO;IAC/C,MAAM,CAAC,SAAS,EAAE,MAAM,CAAmD;IAC3E,MAAM,CAAC,WAAW,EAAE,MAAM,CAAgE;IAE1F,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE;IAepC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE;CA0C3C"}
|
69
node_modules/logkitty/build/ios/IosParser.js
generated
vendored
Normal file
69
node_modules/logkitty/build/ios/IosParser.js
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _dayjs = _interopRequireDefault(require("dayjs"));
|
||||
|
||||
var _constants = require("./constants");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
class IosParser {
|
||||
splitMessages(raw) {
|
||||
const messages = [];
|
||||
let data = raw.toString();
|
||||
let match = data.match(IosParser.timeRegex);
|
||||
|
||||
while (match) {
|
||||
const timeMatch = match[0];
|
||||
data = data.slice((match.index || 0) + timeMatch.length);
|
||||
const nextMatch = data.match(IosParser.timeRegex);
|
||||
const body = nextMatch ? data.slice(0, nextMatch.index) : data;
|
||||
messages.push(`${timeMatch} ${body}`);
|
||||
match = nextMatch;
|
||||
}
|
||||
|
||||
return messages;
|
||||
}
|
||||
|
||||
parseMessages(messages) {
|
||||
return messages.map(rawMessage => {
|
||||
const timeMatch = rawMessage.match(IosParser.timeRegex);
|
||||
|
||||
if (!timeMatch) {
|
||||
throw new Error(`Time regex was not matched in message: ${rawMessage}`);
|
||||
}
|
||||
|
||||
const headerMatch = rawMessage.slice(timeMatch[0].length).match(IosParser.headerRegex) || ['', 'Default', '-1', 'unknown'];
|
||||
const [, priority, pid, tag] = headerMatch;
|
||||
return {
|
||||
platform: 'ios',
|
||||
date: (0, _dayjs.default)(timeMatch[0]).set('millisecond', 0),
|
||||
pid: parseInt(pid.trim(), 10) || 0,
|
||||
priority: _constants.Priority.fromName(priority),
|
||||
tag,
|
||||
messages: [rawMessage.slice(timeMatch[0].length + headerMatch[0].length).trim()]
|
||||
};
|
||||
}).reduce((acc, entry) => {
|
||||
if (acc.length > 0 && acc[acc.length - 1].date.isSame(entry.date) && acc[acc.length - 1].appId === entry.appId && acc[acc.length - 1].pid === entry.pid && acc[acc.length - 1].priority === entry.priority) {
|
||||
acc[acc.length - 1].messages.push(...entry.messages);
|
||||
return acc;
|
||||
}
|
||||
|
||||
return [...acc, entry];
|
||||
}, []);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.default = IosParser;
|
||||
|
||||
_defineProperty(IosParser, "timeRegex", /\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\.[\d+]+/m);
|
||||
|
||||
_defineProperty(IosParser, "headerRegex", /^\s+[a-z0-9]+\s+(\w+)\s+[a-z0-9]+\s+(\d+)\s+\d+\s+([^:]+):/);
|
||||
//# sourceMappingURL=IosParser.js.map
|
1
node_modules/logkitty/build/ios/IosParser.js.map
generated
vendored
Normal file
1
node_modules/logkitty/build/ios/IosParser.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
19
node_modules/logkitty/build/ios/constants.d.ts
generated
vendored
Normal file
19
node_modules/logkitty/build/ios/constants.d.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
declare const codes: {
|
||||
DEBUG: number;
|
||||
DEFAULT: number;
|
||||
INFO: number;
|
||||
ERROR: number;
|
||||
};
|
||||
export declare type PriorityNames = keyof typeof codes;
|
||||
export declare const Priority: {
|
||||
fromName(name: "DEBUG" | "INFO" | "ERROR" | "DEFAULT"): number;
|
||||
toName(code: number): "DEBUG" | "INFO" | "ERROR" | "DEFAULT";
|
||||
fromLetter(letter: string): number;
|
||||
toLetter(code: number): string;
|
||||
DEBUG: number;
|
||||
DEFAULT: number;
|
||||
INFO: number;
|
||||
ERROR: number;
|
||||
};
|
||||
export {};
|
||||
//# sourceMappingURL=constants.d.ts.map
|
1
node_modules/logkitty/build/ios/constants.d.ts.map
generated
vendored
Normal file
1
node_modules/logkitty/build/ios/constants.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/ios/constants.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,KAAK;;;;;CAKV,CAAC;AAEF,oBAAY,aAAa,GAAG,MAAM,OAAO,KAAK,CAAC;AAE/C,eAAO,MAAM,QAAQ;;;;;;;;;CAuBpB,CAAC"}
|
34
node_modules/logkitty/build/ios/constants.js
generated
vendored
Normal file
34
node_modules/logkitty/build/ios/constants.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.Priority = void 0;
|
||||
const codes = {
|
||||
DEBUG: 0,
|
||||
DEFAULT: 1,
|
||||
INFO: 2,
|
||||
ERROR: 3
|
||||
};
|
||||
const Priority = { ...codes,
|
||||
|
||||
fromName(name) {
|
||||
const value = codes[name.toUpperCase()];
|
||||
return value ? value : 0;
|
||||
},
|
||||
|
||||
toName(code) {
|
||||
return Object.keys(codes).find(key => codes[key] === code) || 'DEFAULT';
|
||||
},
|
||||
|
||||
fromLetter(letter) {
|
||||
return codes[Object.keys(codes).find(key => key[0] === letter.toUpperCase()) || 'DEFAULT'];
|
||||
},
|
||||
|
||||
toLetter(code) {
|
||||
return Priority.toName(code)[0];
|
||||
}
|
||||
|
||||
};
|
||||
exports.Priority = Priority;
|
||||
//# sourceMappingURL=constants.js.map
|
1
node_modules/logkitty/build/ios/constants.js.map
generated
vendored
Normal file
1
node_modules/logkitty/build/ios/constants.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/ios/constants.ts"],"names":["codes","DEBUG","DEFAULT","INFO","ERROR","Priority","fromName","name","value","toUpperCase","toName","code","Object","keys","find","key","fromLetter","letter","toLetter"],"mappings":";;;;;;AAAA,MAAMA,KAAK,GAAG;AACZC,EAAAA,KAAK,EAAE,CADK;AAEZC,EAAAA,OAAO,EAAE,CAFG;AAGZC,EAAAA,IAAI,EAAE,CAHM;AAIZC,EAAAA,KAAK,EAAE;AAJK,CAAd;AASO,MAAMC,QAAQ,GAAG,EACtB,GAAGL,KADmB;;AAEtBM,EAAAA,QAAQ,CAACC,IAAD,EAA8B;AACpC,UAAMC,KAAK,GAAGR,KAAK,CAACO,IAAI,CAACE,WAAL,EAAD,CAAnB;AACA,WAAOD,KAAK,GAAGA,KAAH,GAAW,CAAvB;AACD,GALqB;;AAMtBE,EAAAA,MAAM,CAACC,IAAD,EAA8B;AAClC,WACGC,MAAM,CAACC,IAAP,CAAYb,KAAZ,CAAD,CAAwCc,IAAxC,CACGC,GAAD,IAAwBf,KAAK,CAACe,GAAD,CAAL,KAAeJ,IADzC,KAEK,SAHP;AAKD,GAZqB;;AAatBK,EAAAA,UAAU,CAACC,MAAD,EAAyB;AACjC,WAAOjB,KAAK,CACTY,MAAM,CAACC,IAAP,CAAYb,KAAZ,CAAD,CAAwCc,IAAxC,CACGC,GAAD,IAAwBA,GAAG,CAAC,CAAD,CAAH,KAAWE,MAAM,CAACR,WAAP,EADrC,KAEK,SAHK,CAAZ;AAKD,GAnBqB;;AAoBtBS,EAAAA,QAAQ,CAACP,IAAD,EAAuB;AAC7B,WAAON,QAAQ,CAACK,MAAT,CAAgBC,IAAhB,EAAsB,CAAtB,CAAP;AACD;;AAtBqB,CAAjB","sourcesContent":["const codes = {\n DEBUG: 0,\n DEFAULT: 1,\n INFO: 2,\n ERROR: 3,\n};\n\nexport type PriorityNames = keyof typeof codes;\n\nexport const Priority = {\n ...codes,\n fromName(name: PriorityNames): number {\n const value = codes[name.toUpperCase() as PriorityNames];\n return value ? value : 0;\n },\n toName(code: number): PriorityNames {\n return (\n (Object.keys(codes) as PriorityNames[]).find(\n (key: PriorityNames) => codes[key] === code\n ) || 'DEFAULT'\n );\n },\n fromLetter(letter: string): number {\n return codes[\n (Object.keys(codes) as PriorityNames[]).find(\n (key: PriorityNames) => key[0] === letter.toUpperCase()\n ) || 'DEFAULT'\n ];\n },\n toLetter(code: number): string {\n return Priority.toName(code)[0];\n },\n};\n"],"file":"constants.js"}
|
4
node_modules/logkitty/build/ios/simulator.d.ts
generated
vendored
Normal file
4
node_modules/logkitty/build/ios/simulator.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/// <reference types="node" />
|
||||
import { ChildProcess } from 'child_process';
|
||||
export declare function runSimulatorLoggingProcess(): ChildProcess;
|
||||
//# sourceMappingURL=simulator.d.ts.map
|
1
node_modules/logkitty/build/ios/simulator.d.ts.map
generated
vendored
Normal file
1
node_modules/logkitty/build/ios/simulator.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"simulator.d.ts","sourceRoot":"","sources":["../../src/ios/simulator.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAS,MAAM,eAAe,CAAC;AAGpD,wBAAgB,0BAA0B,IAAI,YAAY,CAsBzD"}
|
21
node_modules/logkitty/build/ios/simulator.js
generated
vendored
Normal file
21
node_modules/logkitty/build/ios/simulator.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.runSimulatorLoggingProcess = runSimulatorLoggingProcess;
|
||||
|
||||
var _child_process = require("child_process");
|
||||
|
||||
var _errors = require("../errors");
|
||||
|
||||
function runSimulatorLoggingProcess() {
|
||||
try {
|
||||
return (0, _child_process.spawn)('xcrun', ['simctl', 'spawn', 'booted', 'log', 'stream', '--type', 'log', '--level', 'debug'], {
|
||||
stdio: 'pipe'
|
||||
});
|
||||
} catch (error) {
|
||||
throw new _errors.CodeError(_errors.ERR_IOS_CANNOT_START_SYSLOG, error.message);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=simulator.js.map
|
1
node_modules/logkitty/build/ios/simulator.js.map
generated
vendored
Normal file
1
node_modules/logkitty/build/ios/simulator.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/ios/simulator.ts"],"names":["runSimulatorLoggingProcess","stdio","error","CodeError","ERR_IOS_CANNOT_START_SYSLOG","message"],"mappings":";;;;;;;AAAA;;AACA;;AAEO,SAASA,0BAAT,GAAoD;AACzD,MAAI;AACF,WAAO,0BACL,OADK,EAEL,CACE,QADF,EAEE,OAFF,EAGE,QAHF,EAIE,KAJF,EAKE,QALF,EAME,QANF,EAOE,KAPF,EAQE,SARF,EASE,OATF,CAFK,EAaL;AACEC,MAAAA,KAAK,EAAE;AADT,KAbK,CAAP;AAiBD,GAlBD,CAkBE,OAAOC,KAAP,EAAc;AACd,UAAM,IAAIC,iBAAJ,CAAcC,mCAAd,EAA4CF,KAAD,CAAiBG,OAA5D,CAAN;AACD;AACF","sourcesContent":["import { ChildProcess, spawn } from 'child_process';\nimport { CodeError, ERR_IOS_CANNOT_START_SYSLOG } from '../errors';\n\nexport function runSimulatorLoggingProcess(): ChildProcess {\n try {\n return spawn(\n 'xcrun',\n [\n 'simctl',\n 'spawn',\n 'booted',\n 'log',\n 'stream',\n '--type',\n 'log',\n '--level',\n 'debug',\n ],\n {\n stdio: 'pipe',\n }\n );\n } catch (error) {\n throw new CodeError(ERR_IOS_CANNOT_START_SYSLOG, (error as Error).message);\n }\n}\n"],"file":"simulator.js"}
|
19
node_modules/logkitty/build/types.d.ts
generated
vendored
Normal file
19
node_modules/logkitty/build/types.d.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
import { Dayjs } from 'dayjs';
|
||||
export declare type Platform = 'ios' | 'android';
|
||||
export declare type Entry = {
|
||||
date: Dayjs;
|
||||
pid: number;
|
||||
priority: number;
|
||||
tag?: string;
|
||||
appId?: string;
|
||||
messages: string[];
|
||||
platform: Platform;
|
||||
};
|
||||
export interface IParser {
|
||||
splitMessages(data: string): string[];
|
||||
parseMessages(messages: string[]): Entry[];
|
||||
}
|
||||
export interface IFilter {
|
||||
shouldInclude(entry: Entry): boolean;
|
||||
}
|
||||
//# sourceMappingURL=types.d.ts.map
|
1
node_modules/logkitty/build/types.d.ts.map
generated
vendored
Normal file
1
node_modules/logkitty/build/types.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,oBAAY,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;AAEzC,oBAAY,KAAK,GAAG;IAClB,IAAI,EAAE,KAAK,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,MAAM,WAAW,OAAO;IACtB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACtC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,OAAO;IACtB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;CACtC"}
|
2
node_modules/logkitty/build/types.js
generated
vendored
Normal file
2
node_modules/logkitty/build/types.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=types.js.map
|
1
node_modules/logkitty/build/types.js.map
generated
vendored
Normal file
1
node_modules/logkitty/build/types.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"types.js"}
|
6
node_modules/logkitty/build/utils.d.ts
generated
vendored
Normal file
6
node_modules/logkitty/build/utils.d.ts
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
export declare function getMinPriority(Priority: {
|
||||
fromName: (key: any) => number;
|
||||
}, priorities: {
|
||||
[key: string]: boolean;
|
||||
}, defaultPriority: number): number;
|
||||
//# sourceMappingURL=utils.d.ts.map
|
1
node_modules/logkitty/build/utils.d.ts.map
generated
vendored
Normal file
1
node_modules/logkitty/build/utils.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAC5B,QAAQ,EAAE;IAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAA;CAAE,EAC5C,UAAU,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EACtC,eAAe,EAAE,MAAM,GACtB,MAAM,CASR"}
|
14
node_modules/logkitty/build/utils.js
generated
vendored
Normal file
14
node_modules/logkitty/build/utils.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getMinPriority = getMinPriority;
|
||||
|
||||
function getMinPriority(Priority, priorities, defaultPriority) {
|
||||
const parsedPriorities = Object.keys(priorities).filter(key => priorities[key]).map(key => {
|
||||
return Priority.fromName(key);
|
||||
});
|
||||
return parsedPriorities.length ? Math.min(...parsedPriorities) : defaultPriority;
|
||||
}
|
||||
//# sourceMappingURL=utils.js.map
|
1
node_modules/logkitty/build/utils.js.map
generated
vendored
Normal file
1
node_modules/logkitty/build/utils.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../src/utils.ts"],"names":["getMinPriority","Priority","priorities","defaultPriority","parsedPriorities","Object","keys","filter","key","map","fromName","length","Math","min"],"mappings":";;;;;;;AAAO,SAASA,cAAT,CACLC,QADK,EAELC,UAFK,EAGLC,eAHK,EAIG;AACR,QAAMC,gBAAgB,GAAGC,MAAM,CAACC,IAAP,CAAYJ,UAAZ,EACtBK,MADsB,CACdC,GAAD,IAAiBN,UAAU,CAACM,GAAD,CADZ,EAEtBC,GAFsB,CAEjBD,GAAD,IAAiB;AACpB,WAAOP,QAAQ,CAACS,QAAT,CAAkBF,GAAlB,CAAP;AACD,GAJsB,CAAzB;AAKA,SAAOJ,gBAAgB,CAACO,MAAjB,GACHC,IAAI,CAACC,GAAL,CAAS,GAAGT,gBAAZ,CADG,GAEHD,eAFJ;AAGD","sourcesContent":["export function getMinPriority(\n Priority: { fromName: (key: any) => number },\n priorities: { [key: string]: boolean },\n defaultPriority: number\n): number {\n const parsedPriorities = Object.keys(priorities)\n .filter((key: string) => priorities[key])\n .map((key: string) => {\n return Priority.fromName(key);\n });\n return parsedPriorities.length\n ? Math.min(...parsedPriorities)\n : defaultPriority;\n}\n"],"file":"utils.js"}
|
Reference in New Issue
Block a user