// Requires Node V8 // // Put this script in a directory, then do: // // $ npm init // $ npm install cornerstonelabs-semantic-logging --save // $ node index.js --harmony // // // // Import Semantic Logger ( https://github.com/CornerstoneLabs/semantic-logging ) // var semanticLogging = require("cornerstonelabs-semantic-logging"); // // create a dummy class which implements the logging // class DummyClass extends semanticLogging.SemanticLogger { constructor (request) { super (request); } @info initialising () {}; @info started () {}; @error startFailed () {}; } // // Rename the class to SpecialLogger // Object.defineProperty(DummyClass, "name", "SpecialLogger"); // // SemanticLogger logs the target.constructor.name in the decorator, so this should log as SpecialLogger. // var logger = new SpecialLogger(); logger.info();