Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli-platform-android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ Usage:
npx react-native log-android
```

Starts [`logkitty`](https://github.com/zamotany/logkitty) displaying pretty Android logs.
Starts [`logkitten`](https://github.com/wix-incubator/logkitten) displaying pretty Android logs.
2 changes: 1 addition & 1 deletion packages/cli-platform-android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@react-native-community/cli-config-android": "20.1.3",
"@react-native-community/cli-tools": "20.1.3",
"execa": "^5.0.0",
"logkitty": "^0.7.1",
"logkitten": "^1.3.3",
"picocolors": "^1.1.1"
},
"files": [
Expand Down
36 changes: 23 additions & 13 deletions packages/cli-platform-android/src/commands/logAndroid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,45 @@
* LICENSE file in the root directory of this source tree.
*/

import {
logkitty,
makeTagsFilter,
formatEntry,
formatError,
AndroidPriority,
} from 'logkitty';
import {logkitten} from 'logkitten';
import type {AndroidEntry} from 'logkitten';
import {logger} from '@react-native-community/cli-tools';

const TAGS = new Set(['ReactNative', 'ReactNativeJS']);

const LEVEL_LABELS: Record<number, string> = {
10: 'V',
20: 'D',
30: 'I',
40: 'W',
50: 'E',
60: 'F',
};

function formatEntry(entry: AndroidEntry): string {
const level = LEVEL_LABELS[entry.level] ?? '?';
return `${level} | ${entry.tag}: ${entry.msg}`;
}

async function logAndroid() {
logger.info('Starting logkitty');
logger.info('Starting logkitten');

const emitter = logkitty({
const emitter = logkitten({
platform: 'android',
priority: AndroidPriority.VERBOSE,
filter: makeTagsFilter('ReactNative', 'ReactNativeJS'),
filter: (entry: AndroidEntry) => TAGS.has(entry.tag),
});

emitter.on('entry', (entry) => {
logger.log(formatEntry(entry));
});

emitter.on('error', (error) => {
logger.log(formatError(error));
logger.log(error.message);
});
}

export default {
name: 'log-android',
description: 'starts logkitty',
description: 'starts logkitten',
func: logAndroid,
};
61 changes: 6 additions & 55 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2687,25 +2687,11 @@ ansi-escapes@^4.3.0:
dependencies:
type-fest "^0.21.3"

ansi-fragments@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/ansi-fragments/-/ansi-fragments-0.2.1.tgz#24409c56c4cc37817c3d7caa99d8969e2de5a05e"
integrity sha512-DykbNHxuXQwUDRv5ibc2b0x7uw7wmwOGLBUd5RmaQ5z8Lhx19vwvKV+FAsM5rEA6dEcHxX+/Ad5s9eF2k2bB+w==
dependencies:
colorette "^1.0.7"
slice-ansi "^2.0.0"
strip-ansi "^5.0.0"

ansi-regex@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1"
integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==

ansi-regex@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed"
integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==

ansi-regex@^5.0.0, ansi-regex@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
Expand All @@ -2716,7 +2702,7 @@ ansi-regex@^6.0.1:
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a"
integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==

ansi-styles@^3.2.0, ansi-styles@^3.2.1:
ansi-styles@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
Expand Down Expand Up @@ -3620,11 +3606,6 @@ color-support@^1.1.3:
resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2"
integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==

colorette@^1.0.7:
version "1.2.2"
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==

colorette@^2.0.19:
version "2.0.19"
resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.19.tgz#cdf044f47ad41a0f4b56b3a0d5b4e6e1a2d5a798"
Expand Down Expand Up @@ -3907,11 +3888,6 @@ dateformat@^3.0.3:
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae"
integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==

dayjs@^1.8.15:
version "1.8.21"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.8.21.tgz#98299185b72b9b679f31c7ed987b63923c961552"
integrity sha512-1kbWK0hziklUHkGgiKr7xm59KwAg/K3Tp7H/8X+f58DnNCwY3pKYjOCJpIlVs125FRBukGVZdKZojC073D0IeQ==

debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
Expand Down Expand Up @@ -6149,11 +6125,6 @@ is-finalizationregistry@^1.0.2:
dependencies:
call-bind "^1.0.2"

is-fullwidth-code-point@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=

is-fullwidth-code-point@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
Expand Down Expand Up @@ -7480,14 +7451,10 @@ log-update@^4.0.0:
slice-ansi "^4.0.0"
wrap-ansi "^6.2.0"

logkitty@^0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/logkitty/-/logkitty-0.7.1.tgz#8e8d62f4085a826e8d38987722570234e33c6aa7"
integrity sha512-/3ER20CTTbahrCrpYfPn7Xavv9diBROZpoXGVZDWMw4b/X4uuUwAC0ki85tgsdMRONURyIJbcOvS94QsUBYPbQ==
dependencies:
ansi-fragments "^0.2.1"
dayjs "^1.8.15"
yargs "^15.1.0"
logkitten@^1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/logkitten/-/logkitten-1.3.3.tgz#58d14aef3d6b289f806a0563b5de83d5ef1baa79"
integrity sha512-6oHaRYZonwU2MV0uJ6m27ur73lX18jqOoNmDPvcrt7Uh/vy+XZoIMi/u+k4hj06Nuv8VVVfyUj68SALqSxzIaA==

loose-envify@^1.0.0, loose-envify@^1.4.0:
version "1.4.0"
Expand Down Expand Up @@ -9687,15 +9654,6 @@ slash@3.0.0, slash@^3.0.0:
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==

slice-ansi@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636"
integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==
dependencies:
ansi-styles "^3.2.0"
astral-regex "^1.0.0"
is-fullwidth-code-point "^2.0.0"

slice-ansi@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787"
Expand Down Expand Up @@ -10085,13 +10043,6 @@ strip-ansi@^4.0.0:
dependencies:
ansi-regex "^3.0.0"

strip-ansi@^5.0.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae"
integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==
dependencies:
ansi-regex "^4.1.0"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
Expand Down Expand Up @@ -11143,7 +11094,7 @@ yargs@16.2.0, yargs@^16.2.0:
y18n "^5.0.5"
yargs-parser "^20.2.2"

yargs@^15.1.0, yargs@^15.4.1:
yargs@^15.4.1:
version "15.4.1"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8"
integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==
Expand Down
Loading