patrol icon indicating copy to clipboard operation
patrol copied to clipboard

Possibility to disable logging native commands

Open fylyppo opened this issue 2 years ago • 2 comments

I have suggestion to add option to disable logging native commands.

I use looped $.native.getNativeViews and my output from flutter logs looks like:

Zrzut ekranu 2023-04-4 o 17 18 24

fylyppo avatar Apr 04 '23 15:04 fylyppo

You can already do this by passing your own logger to NativeAutomator.

final config = NativeAutomatorConfig(...);

final automaton = NativeAutomator(
  config: nativeAutomatorConfig
  logger: (String message) {
    // pass `--dart-define PATROL_VERBOSE_LOGS=true` to `patrol_cli` to enable logs
    if (const bool.fromEnvironment('PATROL_VERBOSE_LOGS') {
      print(message);
    }
  }
);

Unfortunately you have to instantiate the NativeAutomator object yourself to do this, which is uncommon. Usually, you use patrolTest() function, which creates the logger inside of it, and doesn't allow for a custom logger.

So I think the requeste here is to add nativeAutomatorLogger argument to PatrolTester's constructor.

bartekpacia avatar Apr 04 '23 15:04 bartekpacia

@bartekpacia We need to be able to do custom logging with patrol, is there any movement on adding nativeAutomatorLogger as an argument to the PatrolTester constructor so it can be used inside patrolTest?

ReubenTurner-esusu avatar Jul 09 '24 15:07 ReubenTurner-esusu

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.

github-actions[bot] avatar Dec 12 '24 15:12 github-actions[bot]