canonical / nm.dart

Native Dart client library to access NetworkManager on Linux.
https://pub.dev/packages/nm
Mozilla Public License 2.0
29 stars 11 forks source link

Add toString() overrides #41

Closed jpnurmi closed 3 years ago

jpnurmi commented 3 years ago

Before:

print(device); // Instance of 'NetworkManagerDevice'
print(connection); // Instance of 'NetworkManagerActiveConnection'

After:

print(device); // NetworkManagerDevice(path: /org/freedesktop/NetworkManager/Devices/1)
print(connection); // NetworkManagerActiveConnection(path: /org/freedesktop/NetworkManager/ActiveConnection/1)

Perhaps a bit verbose, but helps to keep track of what is what... :slightly_smiling_face:

robert-ancell commented 3 years ago

Oh, I didn't know you could do $runtimeType - that will be super useful! :)