flutter-intellij
flutter-intellij copied to clipboard
`dart:developer`: log does not print timestamps
In a fairly big project, we have been using dart:developer's log function to... well... log everything. (actually, we have an abstraction layer above it, but I digress...).
The only issue I have with the log function is that it prints no timestamps in the Android Studio debug console:
Is there a way to enable this? Or is it something that gets lost when debugging with Android Studio?
The dart:developer package appears to provide this information, according to https://github.com/dart-lang/sdk/issues/60450#issuecomment-2772159294
Details about my environment:
OS: macOS Sequoia Version 15.3.2 (24D81)
Android Studio Meerkat | 2024.3.1 Patch 1
Android Studio Meerkat | 2024.3.1 Patch 1
Build #AI-243.24978.46.2431.13208083, built on March 13, 2025
Runtime version: 21.0.5+-13047016-b750.29 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 15.3.2
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4096M
Cores: 8
Metal Rendering is ON
Registry:
vcs.log.index.enable=true
ide.experimental.ui=true
Non-Bundled Plugins:
com.intellij.marketplace (243.24978.86)
name.kropp.intellij.makefile (243.23654.19)
com.intellij.mermaid (0.0.24+IJ.243)
com.github.xepozz.gitattributes (2025.0.14)
com.supermaven.intellij (1.43)
com.intellij.plugin.adernov.powershell (2.8.0)
dev.j-a.swift (1.3.1.388-243)
Key Promoter X (2024.2.2)
TypeSpec (1.1.0)
com.wakatime.intellij.plugin (15.0.3)
Docker (243.24978.54)
Dart (243.23654.44)
com.github.dinbtechit.vscodetheme (1.11.0)
ru.adelf.idea.dotenv (2024.3)
io.flutter (83.0.4)
zielu.gittoolbox (600.1.0+243)
mobi.hsz.idea.gitignore (4.5.6)
dart info output
If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.
#### General info
- Dart 3.7.2 (stable) (Tue Mar 11 04:27:50 2025 -0700) on "macos_arm64"
- on macos / Version 15.3.2 (Build 24D81)
- locale is en-DE
#### Project info
- sdk constraint: '^3.6.1'
- dependencies: async, convert, cupertino_battery_indicator, dart_seq, dart_seq_hive_cache, device_info_plus, encrypt, extended_text, file_picker, fluent_ui, flutter, flutter_libserialport, hive, intl, nmea, package_info_plus, path, path_provider, provider, ricardos_utils, rive, share_plus, shared_preferences, stack_trace, system_theme, url_launcher, uuid, vorun, window_manager
- dev_dependencies: flutter_launcher_icons, flutter_lints, flutter_test, msix
- elided dependencies: 1
#### Process info
| Memory | CPU | Elapsed time | Command line |
| -----: | ---: | -----------: | ------------------------------------------------------------------------------------------ |
| 8 MB | 0.0% | 26:29 | dart development-service --vm-service-uri=http:<path>/ --bind-address=127.0.0.1 --bind-port=0 |
| 3 MB | 0.0% | 08:33:49 | dart devtools --machine --dtd-uri=ws:<path>/rlhziGxD-Tk= |
| 6 MB | 0.0% | 26:29 | dart devtools --no-launch-browser |
| 30 MB | 0.0% | 04:30:29 | dart language-server --client-id=Android-Studio --client-version=AI-243.24978.46 --protocol=analyzer |
| 3 MB | 0.0% | 08:33:50 | dart tooling-daemon --machine |
| 18 MB | 0.0% | 26:47 | flutter_tools.snapshot --no-color run --machine --track-widget-creation --device-id=25181JEGR05427 --start-paused --dart-define=flutter.inspector.structuredErrors=true lib/main.dart |
| 24 MB | 0.5% | 04:31:11 | flutter_tools.snapshot daemon
@elliette: would you expect dart:developer log events to appear in the devtools logging view?
@kenzieschmoll: I expect dart:developer log events appear in the devtools logging view?
@ricardoboss: consider using the devtools logging view?
That's an interesting idea and might be a workaround. How do I active it/use it in Android Studio for debugging?
When you run your app, you should be able to access the logging view from the devtools tool window:
Yes, that's indeed what I was looking. I don't find it particularly useful, though. I'm usually not using the Flutter DevTools (I'm using an IDE afterall and expect my tools to be integrated in the debugger and console views). Maybe I'm alone with my opinion, but I just wish the debug console would print out timestamps.