Skip to content

Commit

Permalink
Address review comments: Shorten AUDIT log prefixes; change to /var/log
Browse files Browse the repository at this point in the history
  • Loading branch information
corbin-phipps committed Jul 15, 2024
1 parent 22d4ebe commit 4351cc6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/common/shared/logging/include/logging/LogUtils.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ enum class LogInstanceId : int {
Audit = 3,
};

#define AUDIT_LOGN LOG_(static_cast<int>(LogInstanceId::Audit), plog::none)
#define AUDIT_LOGF LOG_(static_cast<int>(LogInstanceId::Audit), plog::fatal)
#define AUDIT_LOGE LOG_(static_cast<int>(LogInstanceId::Audit), plog::error)
#define AUDIT_LOGW LOG_(static_cast<int>(LogInstanceId::Audit), plog::warning)
#define AUDIT_LOGI LOG_(static_cast<int>(LogInstanceId::Audit), plog::info)
#define AUDIT_LOGD LOG_(static_cast<int>(LogInstanceId::Audit), plog::debug)
#define AUDIT_LOGV LOG_(static_cast<int>(LogInstanceId::Audit), plog::verbose)
#define AUDITN LOG_(static_cast<int>(LogInstanceId::Audit), plog::none)
#define AUDITF LOG_(static_cast<int>(LogInstanceId::Audit), plog::fatal)
#define AUDITE LOG_(static_cast<int>(LogInstanceId::Audit), plog::error)
#define AUDITW LOG_(static_cast<int>(LogInstanceId::Audit), plog::warning)
#define AUDITI LOG_(static_cast<int>(LogInstanceId::Audit), plog::info)
#define AUDITD LOG_(static_cast<int>(LogInstanceId::Audit), plog::debug)
#define AUDITV LOG_(static_cast<int>(LogInstanceId::Audit), plog::verbose)

namespace logging
{
Expand Down
6 changes: 3 additions & 3 deletions src/linux/server/Main.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ main(int argc, char *argv[])

// Create file and console log appenders.
static plog::ColorConsoleAppender<plog::MessageOnlyFormatter> colorConsoleAppender{};
std::string logFilePath = "/usr/local/";
std::string logFilePath = "/var/log/";
logFilePath += logging::GetLogName("server");
static plog::RollingFileAppender<plog::TxtFormatter> rollingFileAppender(logFilePath.c_str());

// Create the audit log file appender.
std::string auditLogFilePath = "/usr/local/";
std::string auditLogFilePath = "/var/log/";
auditLogFilePath += logging::GetLogName("audit");
static plog::RollingFileAppender<plog::TxtFormatter> auditLogRollingFileAppender(auditLogFilePath.c_str());

Expand All @@ -106,7 +106,7 @@ main(int argc, char *argv[])
plog::init<std::to_underlying(LogInstanceId::Audit)>(logSeverity, &auditLogRollingFileAppender);

LOGN << std::format("Netremote server starting (log level={})", magic_enum::enum_name(logSeverity));
AUDIT_LOGN << std::format("Netremote server starting (log level={})", magic_enum::enum_name(logSeverity));
AUDITN << std::format("Netremote server starting (log level={})", magic_enum::enum_name(logSeverity));

// Create an access point manager and discovery agent.
auto accessPointManager = AccessPointManager::Create();
Expand Down

0 comments on commit 4351cc6

Please sign in to comment.