0.0.2 • Published 5 months ago

cordova-logger-plugin v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

cordova-logger-plugin

This is a simple cordova plugin written in Kotlin and Swift that helps write logs to the device console.

Platforms

iOS

android

Dependencies

  • cordova-plugin-add-swift-support@2.0.2 that uses Swift 4

  • cordova 12

  • cordova-ios 7

  • cordova-android 13

Installation

cordova plugin add cordova-logger-plugin

Methods

  • log

Reference

LoggerConstants.LogType

PropertyValueDescription
INFO"info"
ERROR"error"
WARN"warn"

LoggerConstants.Tag

PropertyValueDescription
DEFAULT"Logger"the default tag used in logs to aid filtering

logOptions

PropertyTypeDefault
logTypeLogTypeLogType.INFO
tagTagTag.DEFAULT
messagestringcalls onError if not specified

Examples

ParamType
successonSuccess
erroronError
optionslogOptions
const logOptions = {
  logType: LoggerConstants.LogType.ERROR,
  tag: "MyApplicationName",
  message: "Your message",
};

function onSuccess() {
  console.log("Message logged successfully");
}

function onError(message) {
  console.log(`Message log failed ${message}`);
}

cordova.plugins.Logger.log(options, onSuccess, onError);
0.0.2

5 months ago

0.0.1

5 months ago