mirror of
https://codeberg.org/andyscott/exercism.git
synced 2024-12-22 06:43:09 -05:00
16 lines
338 B
C++
16 lines
338 B
C++
#include <string>
|
|
|
|
namespace log_line {
|
|
std::string message(std::string line) {
|
|
return line.substr(line.find(" ") + 1);
|
|
}
|
|
|
|
std::string log_level(std::string line) {
|
|
return line.substr(1, line.find("]") - 1);
|
|
}
|
|
|
|
std::string reformat(std::string line) {
|
|
|
|
return message(line) + " (" + log_level(line) + ")";
|
|
}
|
|
} // namespace log_line
|