Orange Soda
Installation
npm i orange-soda -s
Basic Usage
Leveled Logging
// import the libraryconst logger = ; // this are leveled log functions// first the level needs to be set loggerlevel = 'debug'; // this means that only levels higher than or equal to debug will be logged// these for example will be logged...logger;logger; // but this will not...logger; // the format in which the log messages is output can also be changed like so...loggerformat = 'detailed'; // this will make the leveled logs look diffrentlogger;
Access Logging
// import the libraryconst logger = ; // import a http router library like express or connectconst express = ;let app = ; // setup the access logger...loggeraccessformat = 'common'; // set the router to use the logging middleware...app; // handle your requests...app; // listen for requests...app;
Logging Groups
Logging groups are collections of logging methods that all have a similar function. The two default logging groups are the leveled group and access group. The leveled group handles any logs that can be leveled. The access group handles logs that pertain to the access of something. For example, the access of a server. Read more on log groups here.
Transports
Transports are like write streams, but they also know how to format log data according to the transport's settings. The default transports are the console and file transports. The console transport writes to standard out and standard error. The file transport writes to the specified file. Read more on transports here
Docs
More detailed documentation can be found here.