Skip to content

Commit 6271b5f

Browse files
authored
Merge pull request #1563 from igchor/opt_logger
Optimize get_logger function
2 parents ed8147d + d7785a8 commit 6271b5f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/common/logger/ur_logger.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ namespace logger {
1717
Logger create_logger(std::string logger_name, bool skip_prefix = false,
1818
bool skip_linebreak = false);
1919

20-
inline Logger &get_logger(std::string name = "common") {
21-
static Logger logger = create_logger(std::move(name));
20+
inline Logger &get_logger(const char *name = "common") {
21+
static Logger logger = create_logger(name);
2222
return logger;
2323
}
2424

25-
inline void init(std::string name) { get_logger(std::move(name)); }
25+
inline void init(const std::string &name) { get_logger(name.c_str()); }
2626

2727
template <typename... Args>
2828
inline void debug(const char *format, Args &&...args) {

0 commit comments

Comments
 (0)