Created
August 15, 2017 20:42
-
-
Save NickBaynham/7c139160805fd7b235a2dedd0670345b to your computer and use it in GitHub Desktop.
Module Pattern Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (function(){ | |
let log = {}; | |
log.log = msg => logAssist('[**Log]')(msg); | |
log.logCase = msg => logAssist('[**C]')(msg); | |
log.logStep = msg => logAssist('[**S]')(msg); | |
log.logVerification = msg => logAssist('[**V]')(msg); | |
log.logPropertyVerification = msg => logAssist('[**VV]')(msg); | |
log.logError = msg => logAssist('[**Error]')(msg); | |
log.logSection = msg => logAssist('[**Section]')(msg); | |
log.logAction = msg => logAssist('[**Action]')(msg); | |
log.logEntity = msg => logAssist('[**Entity]')(msg); | |
log.logInformation = msg => logAssist('[**Information]')(msg); | |
log.logWarning = msg => logAssist('[**Warning]')(msg); | |
log.logDebug = msg => logAssist('[**Debug]')(msg); | |
log.logImage = msg => logAssist('[**I]')(msg); | |
const logAssist = type => { | |
return msg => { | |
browser.getTitle().then(() => { | |
console.log(type + ' ' + msg); | |
}); | |
} | |
}; | |
return log; | |
}()); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment