VOOZH about

URL: https://www.geeksforgeeks.org/angular-js/angular-js-log-service/

⇱ Angular.js $log Service - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Angular.js $log Service

Last Updated : 19 May, 2021
The $log service in Angular.js is simply used for logging purposes on the browser console. It is used for the debugging and troubleshooting of the error in the code. It has various implementations like a log, warn, info, error, and debugging, and all the names suggest. It is used for logging, warning, information, error display, and debugging message purpose respectively. Now let us see the actual implementation of the $log service in Angular JS. Used Methods: 1. log() Method: This method is used to write the log message on console.

Output:

👁 Image

2. warn() Method: This method is used to display the warning message on console screen.

Output:

👁 Image

3. info() Method: This method is used to display the information message on the console screen.

Output:

👁 Image

4. error() Method: This method is used to write an error message on the console screen.

Output: 

👁 Image

5. debug() Method: This method is used to write the debug message on the console screen.

Output: 

👁 Image
Comment

Explore