Closed kenji21 closed 8 years ago
Looking at the GIF in your blog post didn't show the full path... is another plugin removing the path ?
ah crap I think it's same issue as #4 and it's the find that is not working, can you put a breakpoint and see if there is a workspacePath and what it's value is (NSTextStorage+Extension) injectLinksIntoLogs?
Looks good :
Printing description of path: "/Users/kenji/source-cache/app"
It's missing /Classes in the composed path though ?
Hmm... i've created another "blank" project, to copy the define inside and it works with lastPathComponent. I'm investigating.
@kenji21 when you investigate could you record:
I might have missed some case that breaks connections there
From line 59, got nil :
(lldb) po workspace?.valueForKeyPath("representingFilePath._pathString")
nil
And sometimes it's OK :
(lldb) po workspace?.valueForKeyPath("representingFilePath._pathString")
▿ Optional(/Users/kenji/source-cache/app/App.xcodeproj)
And then, no matches at pattern.matchesInString at NSTextStorage+Extensions:45
OK, i comment too quickly, the no match was due to a third party library log...
now it works... unbelievable
(lldb) po result "/Users/kenji/source-cache/app/App/AppDelegate.m"
so the point of failure looks like the workspacePath ?
I'm sure to have restarted xcode after having built your plugin (had the "load bundle" alert). now it works, i'll post again if it doesn't work after installing the plugin on a teammate mac.
@kenji21 I update the plugin, can you reinstall and give it a try, should be more stable
Installed on a second mac. no issue with the same project on this one. My teammate was having a suggestion : same feature from a stacktrace... (a little harder because no filename, and crash can be in a class extension)
@kenji21 was he running the updated version? I think this one is more stable because it fixed #4
was running at commit 26b60febbb77a5dd3a1bb97c6ea646e76b7da065
ok, try with updated, I'm closing this but if you see it happening let me know and we'll reopen
sure, thanks for support (and many thanks for this great plugin, vote up to have it directly inside xcode)
how I can strip file path with only file name
@oldtrafford91 simply with this code : [[NSString stringWithUTF8String:__FILE__] lastPathComponent]
@krzysztofzablocki updated to current HEAD, restarted xcode, no issue.
Works :
outputs :
Don't work :
The only difference between first and second OKLog define is for the first parameter which changed from
__FILE__
to[[NSString stringWithUTF8String:__FILE__] lastPathComponent]
The issue is that I don't want to have the full file path in the output. But it may be difficult to find corresponding file in the project.