Status Update
Comments
di...@google.com <di...@google.com>
jb...@google.com <jb...@google.com> #2
sm...@gmail.com <sm...@gmail.com> #3
ju...@google.com <ju...@google.com>
gm...@gmail.com <gm...@gmail.com> #4
I have the same issue with Dolphin Beta 4. All the filenames are clickable in the old Logcat, but not in the new one.
aa...@google.com <aa...@google.com> #5
Is there anything special about the file NetworkModule.kt
? Like, is it in the same module/package as the CatalogViewModel.kt
file?
The component that detects the links is a general feature of IntelliJ. It's the same component that does it for stack traces.
Can you try to log the message from NetworkModule
with an exception? So it produces a stack trace in the log.
Are the links in that stack trace detected or not?
sm...@gmail.com <sm...@gmail.com> #6
Both files are in the same module and different package - mark with white line on the picture.
Links are successfully detected, but not all of them, for example AbstractPlainSocketImpl.java:390, AbstractPlainSocketImpl.java:230, AbstractPlainSocketImpl.java:212.
And nothing changed since Dolphin Beta 2. As you can see on picture some log messages can be navigated (mark with green color) and some of them are not (red color).
For more information you can build my project
Android Studio Giraffe | 2022.3.1 Canary 4 Build #AI-223.7571.182.2231.9569140, built on February 6, 2023 Runtime version: 17.0.5+0-b2043.56-9522829 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 11 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 4096M Cores: 24 Registry: external.system.auto.import.disabled=true ide.text.editor.with.preview.show.floating.toolbar=false ide.instant.shutdown=false
Non-Bundled Plugins: detekt (1.22.1) wu.seal.tool.jsontokotlin (3.7.4) com.developerphil.adbidea (1.6.8) com.nvinayshetty.DTOnator (V0.997) mobi.hsz.idea.gitignore (4.4.4)
aa...@google.com <aa...@google.com> #7
OK, so it looks like messages that have a link in them somehow confuses the link detector and it doesn't register the link in the tag area.
Since this works with the old Logcat tool, it should be something about the way the new Logcat uses it. I'm investigating.
aa...@google.com <aa...@google.com>
sm...@gmail.com <sm...@gmail.com> #8
I see that problem is fixed. Can you give me some information about fix publishing?
aa...@google.com <aa...@google.com> #9
Probably next canary release.
sm...@gmail.com <sm...@gmail.com> #10
Hi. Today I faced this bug again. See image in attach. Log record at 10:55:59.101 doesn't register the link in tag area.
Android Studio Giraffe | 2022.3.1 Canary 11 Build #AI-223.8836.35.2231.9848316, built on March 30, 2023 Runtime version: 17.0.6+0-b2043.56-9746777 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 11 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 4096M Cores: 24 Registry: external.system.auto.import.disabled=true debugger.new.tool.window.layout=true ide.text.editor.with.preview.show.floating.toolbar=false ide.instant.shutdown=false ide.experimental.ui=true
Non-Bundled Plugins: detekt (1.22.2) wu.seal.tool.jsontokotlin (3.7.4)
aa...@google.com <aa...@google.com> #11
I can't repro with G Canary 11.
Is there anything that stands out about the FoodRepository.kt
file? Is it in the same module? Is it auto generated?
If you change that log to not log an exception, does it also not detect the link?
What happens if you log an exception that was created in FoodRepository.kt
? As in, the logged stack trace has frames from that file.
Can you reproduce this is a small project that you can share?
sm...@gmail.com <sm...@gmail.com> #12
This is my repo
.suspendOnException {
Timber.e(this.exception) // Line 96
when (exception) {
is SecurityException -> emit(ApiResult.Error(Constants.HTTPConstants.SECURITY_EXCEPTION))
is UnknownHostException -> emit(ApiResult.Error(Constants.HTTPConstants.NO_INTERNET_ERROR_MESSAGE))
is MalformedJsonException -> emit(ApiResult.Error(Constants.HTTPConstants.JSON_MALFORMED))
is JsonSyntaxException -> emit(ApiResult.Error(Constants.HTTPConstants.JSON_EXCEPTION))
else -> emit(ApiResult.Error(this.exception.message.toString()))
}
}
I use ApiResponse wrapper from com.skydoves.sandwich. This line calls when server sends response with plain text instead of json.
aa...@google.com <aa...@google.com> #13
OK, I was able to reproduce.
This is a very strange bug. Probably caused by IntelliJ's link detection code as I can repro this with the old Logcat tool as well.
Log the following in a project that has an actual file named MainActivity.java
:
Log.e("(MainActivity.java:10)", "", new RuntimeException());
Log.e("(MainActivity.java:10)", "foo", new RuntimeException("at "));
Log.e("(MainActivity.java:10)", "", new RuntimeException("at "));
The first 2 logs will have the link in the tag detected but the last one will not.
See screenshot.
In fact, even this:
Log.e("(MainActivity.java:10)", "at ");
Produces a log that doesn't have a link. See screenshot.
It looks like if the first line of the log message contains the string at
(the work at
followed by a
), it somehow breaks the link detection. Probably because at
is a trigger for the exception detection code.
A simple workaround should be so just put something in the message text. In your case:
Timber.e(this.exception, "Error")
I'll investigate further
aa...@google.com <aa...@google.com> #14
Well, it turns out that the fact that putting a (Filename.java:12)
string in the tag actually produces a clickable link is a happy accident.
The link is detected by IntelliJ's
The code that actually finds the file link is
int startIdx = findAtPrefix(line);
int rParenIdx = findRParenAfterLocation(line);
if (rParenIdx < 0) return null;
TextRange methodName = findMethodNameCandidateBefore(line, startIdx, rParenIdx);
It first finds the index of the at
prefix, then finds the index of )
.
It then tries to find a usable link between the 2 indices.
This works great for an actual stack trace line which looks something like this:
at com.example.nologcatlink.MainActivity.onCreate(MainActivity.java:15)
The relevant information is indeed between the at
and the )
But for a Logcat line with a Timber
tag:
2023-04-24 13:12:17.926 28283-28283 (MainActivity.java:10) com.example.nologcatlink E Message
There is no at
prefix, so startIdx == -1
which happily works.
But if the first line contains an at
:
2023-04-24 13:12:17.926 28283-28283 (MainActivity.java:10) com.example.nologcatlink E at Message
Then, startIdx > rParenIdx
and no match is found.
aa...@google.com <aa...@google.com> #15
I added a hyperlink filter that will work with the edge case above
Description
AI-213.7172.25.2113.8622536, JRE 11.0.13+0-b1751.21-8125866x64 JetBrains s.r.o., OS Windows 11(amd64) v10.0 , screens 1920.0x1080.0, 1920.0x1080.0
AS: Dolphin | 2021.3.1 Beta 2
Kotlin plugin: 213-1.7.0-Beta-release-135-AS5744.223
Android Gradle Plugin: 7.3.0-beta02
Gradle: 7.5
Gradle JDK: Oracle OpenJDK version 18.0.1
NDK: from local.properties: (not specified), latest from SDK: (not found)
CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
See picture in attach. I use Timber for looging. X0 is TAG and (filename+line number).
Some events are clickable (green color on the picture) and other are not (red color on the picture).