pubnub / dart

PubNub Dart SDK
Other
28 stars 15 forks source link

How to add debug logging to my pubnub client ? #37

Closed Adidi closed 3 years ago

Adidi commented 3 years ago

In this troubleshooting docs the pubnub instance does not have log property so this code is not working:

  pubnub = PubNub(
      defaultKeyset: Keyset(
        subscribeKey: Config.pubnubSubscribeKey,
        publishKey: Config.pubnubPublishKey,
        uuid: UUID(meId),
      ),
      networking: NetworkingModule(
        retryPolicy: RetryPolicy.exponential(),
      ),
    );

    pubnub.log.level = Level.ALL;
    pubnub.onRecord.listen((record) {
      print('${record.level.name}: ${record.time}: ${record.message}');
    });

What am i missing ?

are commented 3 years ago

The documentation in PubNub docs is not up to date. Please refer to the example in the examples directory: https://github.com/pubnub/dart/blob/master/pubnub/example/logging.dart