Code review comment for lp://staging/~michihenning/unity-scopes-api/add-logging

Revision history for this message
Paweł Stołowski (stolowski) wrote :

1127 +bool Logger::set_channel(Channel c, bool enable)
1128 +{
1129 + auto it = channel_loggers_.find(channel_names[c]);
1130 + assert(it != channel_loggers_.end());
....
1135 +bool Logger::set_channel(string channel_name, bool enable)
1136 +{
1137 + auto it = channel_loggers_.find(channel_name);
1138 + if (it == channel_loggers_.end())
1139 + {
1140 + throw InvalidArgumentException("Logger::set_channel(): invalid channel name: " +

Any particular reason why the first method asserts, and the overloaded one handles missing channel gracefully? Looks like throwing would be good in both cases?

review: Needs Information

« Back to merge proposal