Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Commit

Permalink
Merge cd0172a into 31c66ad
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennifer Oliver committed Oct 24, 2018
2 parents 31c66ad + cd0172a commit f09ee4a
Show file tree
Hide file tree
Showing 3 changed files with 3,210 additions and 3,401 deletions.
9 changes: 5 additions & 4 deletions lib/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,19 @@ const loadedMappings = {};

function IBMCloudEnv() {
const logger = Log4js.getLogger("ibm-cloud-env");
logger.setLevel(DEFAULT_LOG_LEVEL);
logger.level = DEFAULT_LOG_LEVEL;

function init(mappingsFilePath) {
logger.trace("init", mappingsFilePath);
mappingsFilePath = mappingsFilePath || "/server/config/mappings.json";
mappingsFilePath = process.cwd() + mappingsFilePath;
logger.info("Initializing with", mappingsFilePath);

if (!fs.existsSync(mappingsFilePath)) {
logger.warn("File does not exist", mappingsFilePath);
return;
}

logger.info("Initializing with", mappingsFilePath);

let mappingsJson = JSON.parse(fs.readFileSync(mappingsFilePath, "UTF8"));
_.each(mappingsJson, function (value, key) {
processMapping(key, value);
Expand Down Expand Up @@ -146,7 +147,7 @@ function IBMCloudEnv() {
}

function setLogLevel(level) {
logger.setLevel(level);
logger.level = level;
}

function getString(name) {
Expand Down

0 comments on commit f09ee4a

Please sign in to comment.