periodicjs.core.controller
Version:
Customizable CMS platform
97 lines (75 loc) • 4.22 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: utility/aliased/aliased_logger.js</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: utility/aliased/aliased_logger.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>'use strict';
const path = require('path');
const wrapWithDeprecationWarning = require(path.join(__dirname, '../deprecate'));
/**
* Logs an error. Alias for CoreController.protocol.error or CoreController.meta.error
* @return {Function} Returns a function which logs an error using the CoreController logger
*/
var _logError = function () {
/**
* Logs an error
* @param {Object} options Configurable options for error logging
* @param {Object} options.req Express request object
* @param {Object} options.res Express response object
* @param {Object|string} options.err Error object or an error message
*/
let fn = function logError (options = {}) {
return this.protocol.error(options.req, options.res, { err: options.err });
};
let message = 'CoreController.logError: Use CoreController.protocol.error or CoreController.meta.error instead';
return wrapWithDeprecationWarning.call(this, fn, message);
};
/**
* Logs a warning. Alias for CoreController.protocol.warn or CoreController.meta.warn
* @return {Function} Returns a function which logs warnings using CoreController logger
*/
var _logWarning = function () {
/**
* Logs a warning
* @param {Object} options Configurable options for warning logging
* @param {Object} options.req Express request object
* @param {Object} options.res Express response object
* @param {Object|string} options.err Error object or an warning message
*/
let fn = function logWarning (options = {}) {
return this.protocol.warn(options.req, options.res, { err: options.err });
};
let message = 'CoreController.logWarning: Use CoreController.protocol.warn or CoreController.meta.warn instead';
return wrapWithDeprecationWarning.call(this, fn, message);
};
module.exports = {
logError: _logError,
logWarning: _logWarning
};</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="CORE.html">CORE</a></li></ul><h3>Global</h3><ul><li><a href="global.html#_createModel">_createModel</a></li><li><a href="global.html#_deleteModel">_deleteModel</a></li><li><a href="global.html#_getPluginViewDefaultTemplate">_getPluginViewDefaultTemplate</a></li><li><a href="global.html#_getViewModelProperties">_getViewModelProperties</a></li><li><a href="global.html#_handleDocumentQueryErrorResponse">_handleDocumentQueryErrorResponse</a></li><li><a href="global.html#_handleDocumentQueryRender">_handleDocumentQueryRender</a></li><li><a href="global.html#_INITIALIZE_ALIASED_UTILITIES">_INITIALIZE_ALIASED_UTILITIES</a></li><li><a href="global.html#_INITIALIZE_UTILITY_RESPONDER">_INITIALIZE_UTILITY_RESPONDER</a></li><li><a href="global.html#_loadModel">_loadModel</a></li><li><a href="global.html#_logError">_logError</a></li><li><a href="global.html#_logWarning">_logWarning</a></li><li><a href="global.html#_renderView">_renderView</a></li><li><a href="global.html#_respondInKind">_respondInKind</a></li><li><a href="global.html#_searchModel">_searchModel</a></li><li><a href="global.html#_STARTUP">_STARTUP</a></li><li><a href="global.html#_updateModel">_updateModel</a></li><li><a href="global.html#save_revision">save_revision</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Fri Dec 23 2016 13:59:15 GMT-0500 (EST)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>