Loupe Angular Agent - GibraltarSoftware/Gibraltar.Agent.Web.JavaScript GitHub Wiki

#Loupe Angular Agent

The Angular agent has been designed for use in any Angular 1.x solution.

It provides logging functionality via a Loupe.LogService and adds a decorator to the Angular $exceptionHandler service for unhandled exceptions.

Unhandled exceptions

As mentioned above the angular agent decorates the normal angular $exceptionHandler service so that if an error is throw it will be called by angular and take details of the exception and log them to the server.

Logging

See Logging for details on the methods available to log and details on how to log.

Services

The agent has 3 services:

  1. loupe.logService
  2. loupe.stacktraceService
  3. loupe.platformService

Both loupe.stacktraceService and loupe.platformService can be used independently of the loupe.logService if you so wish.

loupe.LogService

This is the service to use for logging messages to the server

loupe.stacktraceService

Wraps stackTrace.js and provides the stackTrace.js functionality

loupe.platformService

Wraps platform.js and provides access to its functionality

Loupe Objects

As well as the services the agent also exposes a couple of loupe specific "objects":

  1. logMessageSeverity - an object literial for specifying the serverity on a log messate
  2. MethodSourceInfo - object to record where a message was logged from see MethodSourceInfo

Both of these are accessed via the logService e.g. logService.write(logService.logMessageSeverity.Verbose,"My Category", "My Caption") and var info = new logService.MethodSourceInfo("app.js")

⚠️ **GitHub.com Fallback** ⚠️