yuhua-chen / MCLog

Xcode plugin for filtering the console area.
MIT License
584 stars 55 forks source link

donot work in Xcode 6.1 #3

Closed alienjun closed 9 years ago

alienjun commented 9 years ago

donot work in Xcode 6.1

alexlee002 commented 9 years ago

yes, It's not support Xcode 6.1. The following is my test code:

    for (int i = 0; i < 200; ++i) {
        switch (i % 3) {
            case 0:
                NSLog(@"hello alex ! dddddddddddddddddddd");
                break;
            case 1:
                NSLog(@"welcome alex ! dadj;fjd;akjdfa;jf;ad");
                break;

            case 2:
                NSLog(@"good bye alex ! 23iiro[ifo[eq[oeoiq");
                break;

            default:
                break;
        }
    }

and I search "hello", the output is:

2014-10-24 16:45:11.541 StackCardView[3413:1175049] hello alex ! dddddddddddddddddddd
2014-10-24 16:45:11.542 StackCardView[3413:1175049] welcome alex ! dadj;fjd;akjdfa;jf;ad
2014-10-24 16:45:11.542 StackCardView[3413:1175049] good bye alex ! 23iiro[ifo[eq[oeoiq
2014-10-24 16:45:11.542 StackCardView[3413:1175049] hello alex ! dddddddddddddddddddd
2014-10-24 16:45:11.542 StackCardView[3413:1175049] welcome alex ! dadj;fjd;akjdfa;jf;ad
2014-10-24 16:45:11.542 StackCardView[3413:1175049] good bye alex ! 23iiro[ifo[eq[oeoiq
2014-10-24 16:45:11.542 StackCardView[3413:1175049] hello alex ! dddddddddddddddddddd
2014-10-24 16:45:11.5

And I found that under Xcode6, an NSLog call is not matched with an IDEConsoleItem, Here is my debuting output in console log:

10/24/14 4:45:10.351 PM Xcode[10191]: [MCLog] _shouldAppendItem: isInput : 0, isOutput: 1, isPrompt: 0, isOutputRequestedByUser: 0, isError: 0, "2014-10-24 16:45:11.506 StackCardView[3413:1175049] hello alex ! dddddddddddddddddddd
2014-10-24 16:45:11.508 StackCardView[3413:1175049] welcome alex ! dadj;fjd;akjdfa;jf;ad
2014-10-24 16:45:11.508 StackCardView[3413:1175049] good bye alex ! 23iiro[ifo["

10/24/14 4:45:10.452 PM Xcode[10191]: [MCLog] _shouldAppendItem: isInput : 0, isOutput: 1, isPrompt: 0, isOutputRequestedByUser: 0, isError: 0, "eq[oeoiq
2014-10-24 16:45:11.508 StackCardView[3413:1175049] hello alex ! dddddddddddddddddddd
2014-10-24 16:45:11.508 StackCardView[3413:1175049] welcome alex ! dadj;fjd;akjdfa;jf;ad
2014-10-24 16:45:11.508 StackCardView[3413:1175049] good bye alex ! 2"
yuhua-chen commented 9 years ago

Yeah... It seems like a bug of console items. I think maybe do a little trick that using the regex to check and fix the line break may work. Any other ideas?

alexlee002 commented 9 years ago

I debugged and found that the console content is read from a file by NSMasterPtyFileHander. It reads batch of log messages a time, not one NsLog a time. And you can check the header file of IDEConsoleAdaptor, which receives the notification and generate the console item.

yuhua-chen commented 9 years ago

thanks~ It's very helpful. I'll figure it out.

alexlee002 commented 9 years ago

I think I have fixed this issue, and i'ill send you a pull request later.

yuhua-chen commented 9 years ago

That's great. :+1: I'm still too busy to work on it. :trollface: