Skip to content

Commit

Permalink
use TM_LOG_PATH to set log path
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyncs committed Feb 1, 2024
1 parent 2025492 commit f9ecad5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/turbomind/utils/logger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ namespace turbomind {
Logger::Logger()
{
#ifndef _MSC_VER
// TODO: use config
SpdLogger::get_instance().set_log_path("/var/log/lmdeploy.log");
char* log_path = std::getenv("TM_LOG_PATH");
if (log_path != nullptr) {
SpdLogger::get_instance().set_log_path(std::string(log_path));
} else {
SpdLogger::get_instance().set_log_path("/var/log/lmdeploy.log");
}
SpdLogger::get_instance().init();
#endif
char* is_first_rank_only_char = std::getenv("TM_LOG_FIRST_RANK_ONLY");
Expand Down

0 comments on commit f9ecad5

Please sign in to comment.