Socket
Socket
Sign inDemoInstall

logkitty

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

logkitty - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

2

build/android/adb.d.ts
/// <reference types="node" />
import { ChildProcess } from 'child_process';
export declare function runAndroidLoggingProcess(adbPath?: string): ChildProcess;
export declare function getAbdPath(customPath?: string): string;
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

@@ -7,3 +7,3 @@ "use strict";

exports.runAndroidLoggingProcess = runAndroidLoggingProcess;
exports.getAbdPath = getAbdPath;
exports.getAdbPath = getAdbPath;
exports.spawnLogcatProcess = spawnLogcatProcess;

@@ -21,7 +21,7 @@ exports.getApplicationPid = getApplicationPid;

function runAndroidLoggingProcess(adbPath) {
const execPath = getAbdPath(adbPath);
const execPath = getAdbPath(adbPath);
return spawnLogcatProcess(execPath);
}
function getAbdPath(customPath) {
function getAdbPath(customPath) {
if (customPath) {

@@ -36,3 +36,3 @@ return _path.default.resolve(customPath);

try {
(0, _child_process.execSync)(`${adbPath} logcat -c`);
(0, _child_process.execSync)(`'${adbPath}' logcat -c`);
} catch (error) {

@@ -55,3 +55,3 @@ throw new _errors.CodeError(_errors.ERR_ANDROID_CANNOT_CLEAN_LOGCAT_BUFFER, error.message);

try {
output = (0, _child_process.execSync)(`${getAbdPath(adbPath)} shell pidof -s ${applicationId}`);
output = (0, _child_process.execSync)(`'${getAdbPath(adbPath)}' shell pidof -s ${applicationId}`);
} catch (error) {

@@ -58,0 +58,0 @@ throw new _errors.CodeError(_errors.ERR_ANDROID_CANNOT_GET_APP_PID, error.message);

@@ -8,4 +8,8 @@ "use strict";

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; }

@@ -43,3 +47,3 @@

platform: 'android',
date: new Date(new Date().getFullYear(), parseInt(timeMatch[1], 10) - 1, parseInt(timeMatch[2], 10), parseInt(timeMatch[3], 10), parseInt(timeMatch[4], 10), parseInt(timeMatch[5], 10)),
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,

@@ -51,3 +55,3 @@ priority: _constants.Priority.fromLetter(priority),

}).reduce((acc, entry) => {
if (acc.length > 0 && acc[acc.length - 1].date.getTime() === entry.date.getTime() && acc[acc.length - 1].tag === entry.tag && acc[acc.length - 1].pid === entry.pid && acc[acc.length - 1].priority === entry.priority) {
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);

@@ -54,0 +58,0 @@ return acc;

@@ -31,12 +31,5 @@ "use strict";

const output = (0, _ansiFragments.container)((0, _ansiFragments.modifier)('dim', parseDate(entry.date)), (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();
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`;
}
function parseDate(value) {
const hour = value.getUTCHours() < 10 ? `0${value.getUTCHours()}` : value.getUTCHours().toString();
const minutes = value.getUTCMinutes() < 10 ? `0${value.getUTCMinutes()}` : value.getUTCMinutes().toString();
const seconds = value.getUTCSeconds() < 10 ? `0${value.getUTCSeconds()}` : value.getUTCSeconds().toString();
return `[${hour}:${minutes}:${seconds}]`;
}
//# sourceMappingURL=formatters.js.map

@@ -8,4 +8,8 @@ "use strict";

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; }

@@ -43,3 +47,3 @@

platform: 'ios',
date: new Date(timeMatch[0]),
date: (0, _dayjs.default)(timeMatch[0]).set('millisecond', 0),
pid: parseInt(pid.trim(), 10) || 0,

@@ -51,3 +55,3 @@ priority: _constants.Priority.fromName(priority),

}).reduce((acc, entry) => {
if (acc.length > 0 && acc[acc.length - 1].date.getTime() === entry.date.getTime() && acc[acc.length - 1].appId === entry.appId && acc[acc.length - 1].pid === entry.pid && acc[acc.length - 1].priority === entry.priority) {
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);

@@ -54,0 +58,0 @@ return acc;

@@ -0,4 +1,5 @@

import { Dayjs } from 'dayjs';
export declare type Platform = 'ios' | 'android';
export declare type Entry = {
date: Date;
date: Dayjs;
pid: number;

@@ -5,0 +6,0 @@ priority: number;

{
"name": "logkitty",
"version": "0.5.0",
"version": "0.6.0",
"description": "Display pretty Android and iOS logs without Android Studio or Console.app, with intuitive Command Line Interface.",

@@ -44,2 +44,3 @@ "keywords": [

"ansi-fragments": "^0.2.1",
"dayjs": "^1.8.15",
"yargs": "^12.0.5"

@@ -46,0 +47,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc