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

feat(redis_client): add logging support #1270

Merged
merged 8 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why get rid of the get/set/delete examples?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thought the simplest getting started would be best but happy to change it back 🤷

// 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