npm.io
1.0.3 • Published 5 years ago

@mangar2/errorlog

Licence
LGPL-3.0-or-later
Version
1.0.3
Deps
0
Size
4 kB
Vulns
0
Weekly
0

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

File errorlog.js
Abstract Errorlog is a small helper to log error messages ( usually used in catch blocks )
Author Volker Böhm
Copyright Copyright ( c ) 2020 Volker Böhm
License This 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
Name Type Attribute Default Description
error Error, string error object or error string
debug boolean optional true true to print the full stack trace

Keywords