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?
« Back to merge proposal
1127 +bool Logger: :set_channel( Channel c, bool enable) loggers_ .find(channel_ names[c] ); loggers_ .end()) ; :set_channel( string channel_name, bool enable) loggers_ .find(channel_ name); loggers_ .end()) Exception( "Logger: :set_channel( ): invalid channel name: " +
1128 +{
1129 + auto it = channel_
1130 + assert(it != channel_
....
1135 +bool Logger:
1136 +{
1137 + auto it = channel_
1138 + if (it == channel_
1139 + {
1140 + throw InvalidArgument
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?