Comments (16)
Any updates/workaround?
from talker.
@Frezyx I was using talker_logger to log Riverpod 2 state changes using the Provider Observer State Logger from official Riverpod 2 docs. Where I realized that iOS builds does not show colors in debug console. So I internally replaced the "print" with "devtools.log". Then It started working.
from talker.
@nikhil7299 in Talker_Flutter.init(), the log method for iOS is debug log, as per my inspection of the package. If you could share which file you changed it would help me produce a similar outcome as yours.
from talker.
I just replaced print to devtools.log inside logger.dart in talker_logger like this -
Previous Code :-
import 'package:talker_logger/talker_logger.dart';
class TalkerLogger {
TalkerLogger({
this.settings = const TalkerLoggerSettings(),
LoggerFilter? filter,
this.formatter = const ExtendedLoggerFormatter(),
void Function(String message)? output,
}) {
// ignore: avoid_print
_output =
output ?? (String message) => message.split('\n').forEach(print);
_filter = filter ?? LogLevelFilter(settings.level);
ansiColorDisabled = false;
}
...
New Code :-
import 'package:talker_logger/talker_logger.dart';
import 'dart:developer' as devtools;
class TalkerLogger {
TalkerLogger({
this.settings = const TalkerLoggerSettings(),
LoggerFilter? filter,
this.formatter = const ExtendedLoggerFormatter(),
void Function(String message)? output,
}) {
// ignore: avoid_print
_output =
output ?? (String message) => message.split('\n').forEach(devtools.log);
_filter = filter ?? LogLevelFilter(settings.level);
ansiColorDisabled = false;
}
...
=> Also run in debug mode as devtool log works in debug mode.
from talker.
Did you check TalkerFlutter.init(), source code? It is actually similar to this. But when I used that started for a few times it was printing fine but suddenly it stopped printing.
from talker.
Hello @arhamsc !
Can you provide your code example ?
I'm using talker_flutter: 3.2.10 version in my projects and my logs console is colored as it should be
from talker.
@Frezyx
Sorry for the late reply, but the code is as follows:
_talker = TalkerFlutter.init();
I tried doing what @nikhil7299 did, the devtools.log is not working actually, when i reverted it back to 'print' it worked, but with the special characters as mentioned earlier without colors.
from talker.
@arhamsc Did you run in debug mode or without debugging? Developer tools .log() works only in debug mode.
from talker.
@arhamsc Did you run in debug mode or without debugging? Developer tools .log() works only in debug mode.
I ran the app in debug mode. And then tried changing back and forth from developer log and print, only with print it worked not with developer logs.
EDIT
you are referring to --debug
flag with flutter run
, right?
from talker.
Is there any update on this thread? @Frezyx
Is it due to the new devctl command that apple has introduced which requires flutter to be run via xcode?
from talker.
@Frezyx @arhamsc
I also reproduced same problem.
In VSCode logs are displayed correctly, but Android Studio (Giraffe version) does not show the logs or shows them without color and not completely (tested on iOS 15 & iOS16)
Android and Web are works correctly on both IDE.
from talker.
final sl = GetIt.instance;
void _setupTakerLogger() {
sl.registerLazySingleton<Talker>(() => TalkerFlutter.init());
Bloc.observer = TalkerBlocObserver(talker: sl.get<Talker>());
FlutterError.onError =
(details) => sl.get<Talker>().handle(details.exception, details.stack);
}
Android Studio's console log example, when run on iOS 15/16
[Talker] �[38;5;4m┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────�[0m
�[38;5;4m│ [INFO] | 14:43:25 763ms | _onSplashPageLoaded - Read token from shared preferences: null�[0m
�[38;5;4m└──────────────────────────────────────────────────────────────────────────────────────────────────────────────�[0m
from talker.
Hello guys!
Thank you for reporting this error. Currently I don't know why logs don't shows in console for something apple devices
I will check this in near future!
from talker.
@arhamsc
Yes I am talking about 'flutter run --debug' but do not use command line, just press F5, the logs will be shown in the Debug Console and not in Terminal.
Also when you modify the internal code of TalkerLogger, make sure to reload "VS Code" window and re-run your flutter app using F5.
from talker.
@nikhil7299 Yes I used the internal vs code run command. And I have tried the steps you have mentioned. It seems to be the general problem of the apple making internal changes which aren't allowing the logs in general within flutter framework.
from talker.
It seems to be printing onto IoS console in a neater way now.
Device: Iphone 14 Pro Max
IOS: 17
But there is not color coding and has some weird alignment and symbols.
from talker.
Related Issues (20)
- Support share_plus ^8.0.0 HOT 2
- Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found when using talker_flutter 4.1.0 HOT 3
- Log inside of a isolate/background and show on app HOT 2
- talker_flutter: TalkerScreen doesn't display stack traces HOT 1
- How can we use the Talker with release mode? HOT 1
- Not printing header/data HOT 2
- Serializable Talker data
- Error "object is unsendable" when using TalkDioLogger inside isolate
- Логи в talker.history.text при генерации в файл не очень читабельны. Можете ли вы сделать так, чтобы при генерации в файл логи выглядели так же, как в терминале?
- itemBuilder не передается в TalkerView, из-за чего нельзя настроить отображение логов
- Can't change colors for talker_flutter HOT 1
- There is no printout on the emulator HOT 5
- Add multiple TalkerObserver in TalkerFlutter.init() HOT 1
- Deprecate TalkerFlutter factory
- Add date to log
- Include provider.name in the output of `TalkerRiverpodObserver` HOT 3
- Problem with share_plus HOT 2
- Support new TimeFormat in ecosystem packages HOT 1
- Riverpod logger is printing the state twice
- Filter stack traces when filtering messages that have stack traces
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from talker.