-(function (global) {
- var Module, Class;
-
- // Load up dependencies
- if (typeof require === 'function') {
- var Ne = require('neon');
- Module = Ne.Module;
- Class = Ne.Class;
- } else {
- Module = global.Module;
- Class = global.Class;
+'use strict';
+
+const Utilities = require('../utilities');
+
+/**
+ * Logger for the javascript console.
+ *
+ * @implements ILogger
+ * @class Console
+ */
+module.exports = class ConsoleLogger {
+ constructor(config) {
+
+ /**
+ * The console it will write to, can be any object that looks
+ * and acts like a console, including other cologne objects.
+ *
+ * @name console
+ * @instance
+ * @memberof Loggers.Console
+ * @type Object
+ * @default global.console
+ */
+ this.console = console;
+
+ /**
+ * The formatter it will use to output the log. If not present it
+ * will output raw JSON
+ *
+ * @name formatter
+ * @instance
+ * @memberof Loggers.Console
+ * @type IFormatter
+ * @default null
+ */
+ this.formatter = null;
+
+ Object.assign(this, config);
+ }
+
+
+ /**
+ * Main entry point, for each incoming argument it will attempt to
+ * format and send to the console.
+ *
+ * @function log
+ * @instance
+ * @memberof Loggers.Console
+ * @return {undefined}
+ */
+ log(...logs) {
+
+ const formattedLogs = logs.map((log) => ({ log: this._format(log), level: log._level }));
+
+ for (const { log, level } of formattedLogs) {
+ this._log(log, level );
+ }
+