Skip to content

beantoan/LoggerJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

INSTRUCTION

  1. Include Logger into your web page:

    • JavaScript
    <script src="logger.js"></script>
    • TypeScript
    import {Logger} from './logger';
  2. Usage:

    • JavaScript
    var Example = {};
    
    Example.functionX = function () {
        var varX = {a: 1, b: 2};
        Logger.info('Example', 'functionX', 'varX', varX);    
        Logger.warn('Example', 'functionX', 'varX', varX);    
        Logger.error('Example', 'functionX', 'varX', varX);    
    };
    • TypeScript
    @Injectable()
    export class ExampleService {
       
      index(page: number, size: number) {
        Logger.info(ExampleService.name, 'index', `page=${page}, size=${size}`);
        Logger.warn(ExampleService.name, 'index', `page=${page}, size=${size}`);
        Logger.error(ExampleService.name, 'index', `page=${page}, size=${size}`);
      }
    }

About

A logger for JavaScript/TypeScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published