Skip to content

Commit

Permalink
feat(redis_client): add logging support (#1270)
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel authored Sep 15, 2023
1 parent e957829 commit b422593
Show file tree
Hide file tree
Showing 4 changed files with 313 additions and 137 deletions.
23 changes: 3 additions & 20 deletions packages/redis_client/example/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:async';

import 'package:redis_client/redis_client.dart';

Future<void> main() async {
Expand All @@ -9,24 +7,9 @@ Future<void> main() async {
// Connect to the Redis server.
await client.connect();

const key = 'HELLO';

final initialValue = await client.get(key: key); // null
assert(initialValue == null, 'Key should not exist.');

// Set the value of a key.
await client.set(key: key, value: 'WORLD');

// Get the value of a key.
final value = await client.get(key: key); // WORLD
assert(value == 'WORLD', 'Value should be "WORLD".');

// Delete the key.
await client.delete(key: key);

final finalValue = await client.get(key: key); // null
assert(finalValue == null, 'Key should not exist.');
// Execute a command.
await client.execute(['PING']); // PONG

// Close the connection to the Redis server.
// Close the connection.
await client.close();
}
8 changes: 7 additions & 1 deletion packages/redis_client/lib/redis_client.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
export 'src/redis_client.dart'
show RedisClient, RedisCommandOptions, RedisJson, RedisSocketOptions;
show
RedisClient,
RedisCommandOptions,
RedisException,
RedisJson,
RedisLogger,
RedisSocketOptions;
Loading

0 comments on commit b422593

Please sign in to comment.