fail-whale
v1.0.7
Published
Easily print a fail whale
Downloads
187
Maintainers
Readme
fail-whale
▄████████████▄▐█▄▄▄▄█▌
█████▌▄▌▄▐▐▌██▌▀▀██▀▀
███▄█▌▄▌▄▐▐▌▀██▄▄█▌
▄▄▄▄█████████████
Easily print a fail whale
import { failWhale } from 'fail-whale';
// When something bad happens
failWhale("Something went wrong :(")
/*
Prints to console.error:
▄████████████▄▐█▄▄▄▄█▌
█████▌▄▌▄▐▐▌██▌▀▀██▀▀
███▄█▌▄▌▄▐▐▌▀██▄▄█▌
▄▄▄▄█████████████
Something went wrong :(
*/
Inject your own logger (override default console.error)
const logWarn = {
error: (msg: any) => console.warn(msg)
}
failWhale("Warn you instead", logWarn)
/*
Prints to console.warn:
▄████████████▄▐█▄▄▄▄█▌
█████▌▄▌▄▐▐▌██▌▀▀██▀▀
███▄█▌▄▌▄▐▐▌▀██▄▄█▌
▄▄▄▄█████████████
Warn you instead
*/