Gathering detailed insights and metrics for @devicefarmer/adbkit-logcat
Gathering detailed insights and metrics for @devicefarmer/adbkit-logcat
Gathering detailed insights and metrics for @devicefarmer/adbkit-logcat
Gathering detailed insights and metrics for @devicefarmer/adbkit-logcat
npm install @devicefarmer/adbkit-logcat
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
16 Stars
160 Commits
6 Forks
2 Watching
4 Branches
1 Contributors
Updated on 19 Aug 2023
JavaScript (70.21%)
TypeScript (29.79%)
Cumulative downloads
Total Downloads
Last day
-26.4%
10,890
Compared to previous day
Last week
-14.8%
80,649
Compared to previous week
Last month
36.1%
330,312
Compared to previous month
Last year
75.5%
2,220,221
Compared to previous year
adbkit-logcat provides a Node.js interface for working with output produced by the Android logcat
tool. It takes a log stream (that you must create separately), parses it, and emits log entries in real-time as they occur. Possible use cases include storing logs in a database, forwarding logs via MessagePack, or just advanced filtering.
Install via NPM:
1npm install --save adbkit-logcat
1const logcat = require('adbkit-logcat') 2const {spawn} = require('child_process') 3 4// Retrieve a binary log stream 5const proc = spawn('adb', ['logcat', '-B']) 6 7// Connect logcat to the stream 8reader = logcat.readStream(proc.stdout) 9reader.on('entry', entry => { 10 console.log(entry.message) 11}) 12 13// Make sure we don't leave anything hanging 14process.on('exit', () => { 15 proc.kill() 16})
Exposes Priority
. See below for details.
Exposes Reader
. See below for details.
Creates a logcat reader instance from the provided logcat event Stream
. Note that you must create the stream separately.
IMPORTANT: The default line break behavior has changed on newer Android versions. Since adbkit-logcat merely parses output and is not able to communicate with ADB, you must externally detect whether you need the fixLineFeeds
option enabled or not. For newer versions it should be off.
'binary'
, which (for example) adb logcat -B
produces. Defaults to 'binary'
.'\n'
into '\r\n'
, which broke binary content. If set, this option reverses the transformation before parsing the stream. Defaults to true
for backwards compatibility. You MUST set this option to false
on newer versions.Reader
instance.The following static properties are available:
0
.1
. Not available when reading a stream.2
.3
.4
.5
.6
.7
.8
. Not available when reading a stream.Static method to convert the given letter
into a numeric priority. For example, Priority.fromName('d')
would return Priority.DEBUG
.
String
. Any single, case-insensitive character matching the first character of any Priority
constant is accepted.Number
, or undefined
.Static method to convert the given name
into a numeric priority. For example, Priority.fromName('debug')
(or Priority.fromName('d')
) would return Priority.DEBUG
.
String
. Any full, case-insensitive match of the Priority
constants is accepted. If no match is found, falls back to Priority.fromLetter()
.Number
, or undefined
.Static method to convert the numeric priority into its letter representation. For example, Priority.toLetter(Priority.DEBUG)
would return 'D'
.
Number
. Any Priority
constant value is accepted.String
letter, or undefined
.Static method to convert the numeric priority into its full string representation. For example, Priority.toLetter(Priority.DEBUG)
would return 'DEBUG'
.
Number
. Any Priority
constant value is accepted.String
, or undefined
.A reader instance, which is an EventEmitter
.
The following events are available:
Error
.Entry
. See below for details.For advanced users. Manually constructs a Reader
instance. Useful for testing and/or playing around. Normally you would use logcat.readStream()
to create the instance.
logcat.readStream()
for details.For advanced users. When instantiated manually (not via logcat.readStream()
), connects the Reader
instance to the given stream.
logcat.readStream()
for details.Reader
instance.Convenience method for ending the stream.
Reader
instance.Skip entries with the provided tag. Alias for reader.include(tag, Priority.SILENT)
. Note that even skipped events have to be parsed so that they can be ignored.
'*'
, works the same as reader.excludeAll()
.Reader
instance.Skip ALL entries. Alias for reader.includeAll(Priority.SILENT)
. Any entries you wish to see must be included via include()
/includeAll()
.
Reader
instance.Include all entries with the given tag and a priority higher or equal to the given priority
.
'*'
, works the same as reader.includeAll(priority)
.Priority
constant or any String
value accepted by Priority.fromName()
is accepted. Defaults to Priority.DEBUG
.Reader
instance.Include all entries with a priority higher or equal to the given priority
.
reader.include()
for details.Reader
instance.Resets all inclusions/exclusions.
Reader
instance.A log entry.
The following properties are available:
Date
.Number
.Number
.Number
. You can use logcat.Priority
to convert the value into a String
.String
.String
.Converts the entry back to the binary log format.
Buffer
.See CONTRIBUTING.md.
See LICENSE.
Copyright © The OpenSTF Project. All Rights Reserved.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/4 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More