Commit a7c0163e authored by Paal Kvamme's avatar Paal Kvamme
Browse files

Allow enabling SDAPI logging using environment variables.

parent ae179d11
......@@ -24,6 +24,7 @@
#include "mtguard.h"
#include "../exception.h"
#include "../iocontext.h"
#include "environment.h"
#include <vector>
#include <string>
......@@ -977,16 +978,18 @@ SeismicStoreFile::SeismicStoreFile(const std::string& filename, OpenMode mode, c
//TODO-Low: if (!context->_pedantic.empty())
// extra[Constants::KPedantic] = context->_pedantic;
// TODO-Low enable logging for manager and/or dataset
bool sd_mgr_log = Environment::getNumericEnv("OPENZGY_SDMANAGER_LOG",0) > 0;
bool sd_ds_log = Environment::getNumericEnv("OPENZGY_SDDATASET_LOG",0) > 0;
auto manager = std::make_shared<seismicdrive::SDManager>
(context->_sdurl, context->_sdapikey);
manager->setLogStatus(sd_mgr_log);
std::shared_ptr<seismicdrive::SDGenericDataset> dataset;
if (mode != OpenMode::Closed) {
_logger(5, std::stringstream()
<< "make dataset using manager "
<< std::hex << (std::uint64_t)manager.get());
dataset = std::make_shared<seismicdrive::SDGenericDataset>
(manager.get(), filename);
(manager.get(), filename, sd_ds_log);
_logger(5, "dataset ok");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment