Giter VIP home page Giter VIP logo

adbkit-logcat's People

Contributors

gunta avatar koral-- avatar sorccu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adbkit-logcat's Issues

This repository is no longer maintained

Warning

This project along with other ones in OpenSTF organisation is provided as is for community, without active development.

You can check any other forks that may be actively developed and offer new/different features here.

Active development has been moved to DeviceFarmer organisation.

About the storage of the

Hello, I just use the logs function of the STF, but the message is not storing in the database, should I change some codes?

Error when get logcat from huawei P9

There is a error when I get logcat from huawei P9. seems adbkit can't handle the corner case with empty entry data,error details as follows:

events.js:160
throw er; // Unhandled 'error' event
^

Error: Unprocessable entry data ''
at Binary._processEntry (/usr/lib/nodejs/npm/node_modules/lib/node_modules/stf/node_modules/adbkit-logcat/lib/logcat/parser/binary.js:77:26)
at Binary.parse (/usr/lib/nodejs/npm/node_modules/lib/node_modules/stf/node_modules/adbkit-logcat/lib/logcat/parser/binary.js:54:14)
at LineTransform. (/usr/lib/nodejs/npm/node_modules/lib/node_modules/stf/node_modules/adbkit-logcat/lib/logcat/reader.js:84:33)
at emitOne (events.js:96:13)
at LineTransform.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at LineTransform.Readable.push (_stream_readable.js:134:10)
at LineTransform.Transform.push (_stream_transform.js:128:32)
at LineTransform._transform (/usr/lib/nodejs/npm/node_modules/lib/node_modules/stf/node_modules/adbkit/lib/adb/linetransform.js:39:12)
at LineTransform.Transform._read (_stream_transform.js:167:10)
at LineTransform.Transform._write (_stream_transform.js:155:12)
at doWrite (_stream_writable.js:334:12)
at writeOrBuffer (_stream_writable.js:320:5)
at LineTransform.Writable.write (_stream_writable.js:247:11)
at Socket.ondata (_stream_readable.js:555:20)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:548:20)

Parsing issues on L

My Nexus 5 is running the L developer preview and logcat parsing does not appear to work correctly. I get a bunch of garbage, and sometimes errors about invalid format ''.

For example, eclipse's logcat prints:

07-21 14:52:55.537: V/minus:instant(6496): incoming: {"type":"ONLINE_USERS","online_users":null,"live_chat_users":0,"live_chat_string":"8,764 cats hanging out..."}

and the JSON returned by adbkit is:

{
    "date": "1970-02-02T23:36:32.033Z",
    "message": "incoming: ",
    "pid": 251658326,
    "priority": 109,
    "tag": "inus:instant",
    "tid": 1666436449
}

Note the date, the incomplete message, the cut-off tag, etc.

More extreme cases have large bunches of tags merged together with unicode garbage:

{"date":"2022-05-02T00:05:58.952Z","pid":1668246636,"tid":1667330131,"priority":115,"tag":", 112(2MB) LOS objects, 219% free, 47MB/65MB, paused 6.026ms total 53.166ms","message":"4\u0000\u0018\u0000`\u0019\u0000\u0000`\u0019\u0000\u0000�`�S���0\u0000\u0000\u0000\u0000\u0003minus::LocationUtils\u0000Using play services location!\u00009\u0000\u0018\u0000\u001d\u0003\u0000\u0000,\u0003\u0000\u0000�`�S��\u00121\u0002\u0000\u0000\u0000Nu\u0000\u0000\u0003\u0005\u0000\u0000\u0000\u0000\u0000\u0000\rY\u001d0\u0002\u0019\u0000\u0000\u0000.PluggedInAnalyzerService\u0000N'\u0000\u0000\u0000BM\u0000\u0000\n\u0010\u0000\u0018\u0000\u001d\u0003\u0000\u0000�\u0003\u0000\u0000�`�S\u001e+]1\u0002\u0000\u0000\u0000�\n\u0000\u0000\u0002\u0006\u0000\u0000\u0000Binder\n�\u0000\u0018\u0000`\u0019\u0000\u0000`\u0019\u0000\u0000�`�S\u001f��1\u0000\u0000\u0000\u0000\u0003minus::CheckInLocationListener\u0000Location changed Location[network 40.753864,-73.992259 acc=34 et=+3d20h6m51s501ms {Bundle[mParcelledData.dataSize=548]}]\u00000\u0000\u0018\u0000n\u0005\u0000\u0000�X\u0000\u0000�`�S3��1\u0000\u0000\u0000\u0000\u0004MicrophoneInputStream\u0000mic_starting eze@97e187f\u00003\u0000\u0018\u0000n\u0005\u0000\u0000�X\u0000\u0000�`�S�\r\u001a2\u0000\u0000\u0000\u0000\u0004HotwordRecognitionRnr\u0000Starting hotword detection.\u0000c\u0000\u0018\u0000`\u0019\u0000\u0000�\u001a\u0000\u0000�`�S5�\u001d2\u0000\u0000\u0000\u0000\u0003minus::CheckInLocationListener\u0000Cached location Location[fused 40.753834,-73.992279 acc=30 et=?!?]\u0000T\u0000\u0018\u0000`\u0019\u0000\u0000�\u001a\u0000\u0000�`�S�6%2\u0000\u0000\u0000\u0000\u0003minus::CheckInLocationListener\u0000Cached location time = 2014-07-21T02:44:30GMT-04:00\u00004\u0000\u0018\u0000`\u0019\u0000\u0000`\u0019\u0000\u0000�`�S?�%2\u0000\u0000\u0000\u0000\u0003minus::LocationUtils\u0000Using play services location!\u0000�\u0000\u0018\u0000`\u0019\u0000\u0000�
// continues on for a while...

Let me know if there's any more info I can provide. I'm getting the data with:

    adb.openLogcat(deviceId)
    .then (logcat) ->
        logcat.includeAll Logcat.Priority.VERBOSE

        console.log 'logcat!', logcat
        logcat.on 'entry', (entry) ->
            console.log 'entry', entry

Using my Galaxy Nexus running KitKat works just fine, which is why I suspect some binary format change on L....

Error parsing log stream for Android 5.0.2

Well, this is the same issue as #2, this library is great and it saved lots of time while I have to deal with ADB.
So is there any plan to support L in the future? Thanks.

Environment

  • win7 x64
  • node: v 4.2.3
  • adbkit: 2.4.0
  • Android version on Device: 5.0.2
  • Android Debug Bridge version 1.0.32 Revision 09a0d98bebce-android

CODE

var adb = require('adbkit');
var moment = require('moment');
var client = adb.createClient();

//001198336888
//FIPZMZZP99999999
client.openLogcat('FIPZMZZP99999999', {
    clear: true,
}, function (err, reader) {
    reader.on('entry', function (entry) {
        // var line = moment(entry.date).format('MM-DD HH:mm:ss.SSS') + ' ' +
        //     entry.pid + '-' + entry.tid + '/? ' + entry.priority + '/' + entry.tag + ': ' + entry.message;
        // console.log(line.trim());
        console.log(entry);
    });

    reader.on('end', function () {
        console.log(moment(new Date()).format('MM-DD HH:mm:ss.SSS') + ' Logcat Reader Event - END');
    });

    reader.on('error', function (err) {
        console.log(moment(new Date()).format('MM-DD HH:mm:ss.SSS') + ' Logcat Reader Event - ERROR' + err);
    });

    reader.on('finish', function () {
        console.log(moment(new Date()).format('MM-DD HH:mm:ss.SSS') + ' Logcat Reader Event - FINISH');
    });
});

output
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.