Skip to content

Lightweight logging library with zero dependencies for NodeJs and browsers.

License

Notifications You must be signed in to change notification settings

muratersin/atay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm version

Atay is a Lightweight logging library with zero dependencies for NodeJs.

Installing:

    npm install atay

Usage:

    const atay = require('atay');
    
    const logger = atay.createLogger();

    logger.info('Hello Moon!');

Firstly, Atay is not fully customizable and flexible logging librarry. My purpose of writing this librarry, avoid time waste when creating new microservice or server app. Many other logging libraries are had complex configuration objects especially when you want write logs to a file.

Default configuration is shown below:

    const config = {
      name: 'Atay',
      showDate: true,
      stopProcessAfterFatalError: false,
      streams: {
        info: null,
        warn: null,
        error: null,
        debug: null,
        fatal: null,
      },
    };

    const logger = atay.createLogger(config);
  • name(String): Your application name.
  • showDate(Boolean): If is it true, you can see your logs with date.
  • stopProcessAfterFatalError(Boolean): If is it true, when you use 'fatal' level log, your process will be stopped immediately after writing log.
  • streams:(Object): If you want your logs keeping in a file, just set a path, paths can be different or same for every level. Path must be absolute path and a directory. Example '/Users/your-user/project/tmp',

You can use one of this levels, and this levels can't changes.

  1. info
  2. warn
  3. error
  4. debug
  5. fatal

About

Lightweight logging library with zero dependencies for NodeJs and browsers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published