1.0.3 • Published 3 years ago

@mangar2/errorlog v1.0.3

Weekly downloads
4
License
LGPL-3.0-or-later
Repository
github
Last release
3 years ago

Abstract

Errorlog is a small helper to log error messages ( usually used in catch blocks )

Example

errorLog('hello world')
errorLog(new Error('hello world'), false)

Contents

Meta

Fileerrorlog.js
AbstractErrorlog is a small helper to log error messages ( usually used in catch blocks )
AuthorVolker Böhm
CopyrightCopyright ( c ) 2020 Volker Böhm
LicenseThis software is licensed under the GNU LESSER GENERAL PUBLIC LICENSE Version 3 . It is furnished "as is" , without any support , and with no warranty , express or implied , as to its usefulness for any purpose .

Global functions

errorLog

readonly errorLog (error, debug)

logs an error

  • If error is a string , it just logs the string .
  • If error is an Error object it logs the message and the stack trace ( if the debug flag is true ) .

errorLog Parameters

NameTypeAttributeDefaultDescription
errorError, stringerror object or error string
debugbooleanoptionaltruetrue to print the full stack trace