• Russ Watson

Class logging with decorators

Bakerstreet has open sourced one of its logging utilities, ts-log-class, and has made it available on NPM.

ts-log-class is a helper utility that will add log output for all methods of a class by adding a @log decorator to the class definition. Stop adding console.log or other logging strategies within each method, but have it done for you.

The default log function takes a set of properties and forms them into a message using JSON.stringify and uses console.log for the message.

Overrides for the function to format the set of properties and the default out methods are provided.

Usage examples can be found in the README and within the tests.

#developers #typescript #logger #decorators #ES2017

57 views0 comments

Recent Posts

See All

We are hiring!

Software Engineer (All levels) Do you like working with bleeding edge technologies? Do you view yourself as a best-in-class developer? Do you enjoy defining and contributing to a set of best practices


675 Town Square Blvd., Suite 200
Garland, Texas, 75040