From e3daa00d9bc471b3c96feea16a40d768d29069d0 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Thu, 26 May 2022 15:13:38 -0700 Subject: [PATCH] Tick-tock usage of GZ_TRANSPORT_LOG_SQL_PATH Signed-off-by: methylDragon --- log/include/gz/transport/log/Log.hh | 3 +++ log/src/Log.cc | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/log/include/gz/transport/log/Log.hh b/log/include/gz/transport/log/Log.hh index c999e448a..fca4465a1 100644 --- a/log/include/gz/transport/log/Log.hh +++ b/log/include/gz/transport/log/Log.hh @@ -41,6 +41,9 @@ namespace gz /// \brief Name of Environment variable containing path to schema const std::string SchemaLocationEnvVar = "GZ_TRANSPORT_LOG_SQL_PATH"; + // TODO(CH3): Deprecated. Remove this on ticktock. + const std::string SchemaLocationEnvVarDeprecated = "IGN_TRANSPORT_LOG_SQL_PATH"; + /// \brief Interface to a log file class GZ_TRANSPORT_LOG_VISIBLE Log { diff --git a/log/src/Log.cc b/log/src/Log.cc index bf5311b78..b10683dd7 100644 --- a/log/src/Log.cc +++ b/log/src/Log.cc @@ -444,6 +444,20 @@ bool Log::Open(const std::string &_file, const std::ios_base::openmode _mode) // Test hook so tests can be run before `make install` std::string schemaFile; const char *envPath = std::getenv(SchemaLocationEnvVar.c_str()); + + // TODO(CH3): Deprecated. Remove this on ticktock. + if (!(envPath)) + { + envPath = std::getenv(SchemaLocationEnvVarDeprecated.c_str()); + + if ((envPath)) + { + LWRN("Found schema using deprecated environment variable [" + << SchemaLocationEnvVarDeprecated.c_str() + << "]. Please use [" << SchemaLocationEnvVar.c_str() << "] instead.") + } + } + if (envPath) { schemaFile = envPath;