Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logger not resets log color #86

Closed
westito opened this issue Dec 19, 2022 · 11 comments · Fixed by #175
Closed

Logger not resets log color #86

westito opened this issue Dec 19, 2022 · 11 comments · Fixed by #175
Labels
bug Something isn't working work_in_progress Сurrently under work

Comments

@westito
Copy link
Contributor

westito commented Dec 19, 2022

Képernyőfotó 2022-12-19 - 9 34 02

@Frezyx
Copy link
Owner

Frezyx commented Dec 19, 2022

Hello @westito!
Please provide information about version you use and additional usage code.
Which library exactly you use ?

@westito
Copy link
Contributor Author

westito commented Dec 19, 2022

Oh, sry.

dio: ^4.0.6
talker_dio_logger: ^1.0.0
final _dio = Dio()..interceptors.add(
    TalkerDioLogger(
      settings: const TalkerDioLoggerSettings(
        printRequestHeaders: true,
        printResponseHeaders: true,
        printResponseMessage: true,
      ),
    ),
  );

That's all code I have according to Dio

IntelliJ IDEA 2022.3.1 RC (Ultimate Edition)
Build #IU-223.8214.27, built on December 14, 2022
Licensed to Marcell Nemeth
Subscription is active until October 21, 2023.
For educational use only.
Runtime version: 17.0.5+1-b653.23 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.1
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 10
Metal Rendering is ON
Registry:
    debugger.new.tool.window.layout=true
    ide.experimental.ui=true
    ide.balloon.shadow.size=0

Non-Bundled Plugins:
    com.github.copilot (1.1.37.2188)
    com.ankit.mahadik.json.dart.class (2.15)
    Dart (223.8214.16)
    andrasferenczi.dart-data-plugin (0.2.0)
    com.localizely.flutter-intl (1.18.1-2022.2)
    com.intellij.lang.jsgraphql (3.3.0)
    izhangzhihao.rainbow.brackets (2022.3.5)
    pro.bashsupport (3.0.4.223)
    io.flutter (71.1.6)
    de.mariushoefler.flutter_enhancement_suite (1.6.0)

Kotlin: 223-1.7.21-release-272-IJ8214.27
Flutter 3.3.10 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 135454af32 (4 days ago) • 2022-12-15 07:36:55 -0800
Engine • revision 3316dd8728
Tools • Dart 2.18.6 • DevTools 2.15.0

@Frezyx
Copy link
Owner

Frezyx commented Dec 19, 2022

I will check this bug in near future

@nocturnalflame
Copy link

nocturnalflame commented Dec 26, 2022

@Frezyx In much the same way, overriding the debug colors on TalkerFlutter.init() doesn't actually override the logger at all. It keeps the same default log colors:


final Talker appLog = TalkerFlutter.init(
  settings: TalkerSettings(
    enabled: true,
    useHistory: true,
    maxHistoryItems: 100,
    useConsoleLogs: true,
  ),
  logger: TalkerLogger(
    settings: TalkerLoggerSettings(
      enableColors: true,
      colors: {
        LogLevel.good: AnsiPen()..green(),
        LogLevel.fine: AnsiPen()..cyan(),
        LogLevel.info: AnsiPen()..white(),
        LogLevel.debug: AnsiPen()..blue(),
        LogLevel.verbose: AnsiPen()..magenta(),
      },
    ),
  ),
);

@Frezyx
Copy link
Owner

Frezyx commented Dec 27, 2022

Hello @nocturnalflame !
Thank you for this issue. I will check this bug.

@nocturnalflame
Copy link

@Frezyx I tried to take a look. I'm not sure what's going on, but my IntelliJ isn't updating the colors. It seems whatever colors are defaulted for in TalkerFlutter.init(). I tried with just Talker(). It doesn't actually work at all even when I modify the source code to have the pen passed in directly. Not sure what I'm doing wrong. Maybe I can get some tips. I wouldn't mind contributing to the repository in some way as well too!

@westito
Copy link
Contributor Author

westito commented Dec 28, 2022

@Frezyx In much the same way, overriding the debug colors on TalkerFlutter.init() doesn't actually override the logger at all. It keeps the same default log colors:


final Talker appLog = TalkerFlutter.init(
  settings: TalkerSettings(
    enabled: true,
    useHistory: true,
    maxHistoryItems: 100,
    useConsoleLogs: true,
  ),
  logger: TalkerLogger(
    settings: TalkerLoggerSettings(
      enableColors: true,
      colors: {
        LogLevel.good: AnsiPen()..green(),
        LogLevel.fine: AnsiPen()..cyan(),
        LogLevel.info: AnsiPen()..white(),
        LogLevel.debug: AnsiPen()..blue(),
        LogLevel.verbose: AnsiPen()..magenta(),
      },
    ),
  ),
);

The colors map is working only in console. There is no option to override colors in console widget right now.

@westito
Copy link
Contributor Author

westito commented Dec 28, 2022

I will check this bug in near future

I made a PR for fix this issue and more.
#88

@Frezyx
Copy link
Owner

Frezyx commented Dec 28, 2022

@Frezyx I tried to take a look. I'm not sure what's going on, but my IntelliJ isn't updating the colors. It seems whatever colors are defaulted for in TalkerFlutter.init(). I tried with just Talker(). It doesn't actually work at all even when I modify the source code to have the pen passed in directly. Not sure what I'm doing wrong. Maybe I can get some tips. I wouldn't mind contributing to the repository in some way as well too!

settings: TalkerSettings(
enabled: true,
useHistory: true,
maxHistoryItems: 100,
useConsoleLogs: true,
),

Hello @nocturnalflame !
I run shop_app_example app with your provided config for talker and it works.
Can you provide some additional information for your issue ?
image

@nocturnalflame
Copy link

Interesting. This may be a configuration issue on my end then... I'm not sure what's going on, but it isn't behaving as I expect it to.

@westito
Copy link
Contributor Author

westito commented Jan 3, 2023

Interesting. This may be a configuration issue on my end then... I'm not sure what's going on, but it isn't behaving as I expect it to.

As I wrote above, you can't change the colors in logger widget.

@Frezyx Frezyx pinned this issue Jan 4, 2023
@Frezyx Frezyx added bug Something isn't working work_in_progress Сurrently under work labels Nov 8, 2023
@Frezyx Frezyx linked a pull request Jan 26, 2024 that will close this issue
@Frezyx Frezyx unpinned this issue Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working work_in_progress Сurrently under work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants