browser-logger icon indicating copy to clipboard operation
browser-logger copied to clipboard

Making this awesome logger universal

Open Offirmo opened this issue 7 years ago • 4 comments

This logger is great!

However, you are exposing the Apache/bunyan API.

What would be awesome would be to support all logger APIs at once, so that yours could be plugged to anything (JS console, syslog, angular...)

I've listed all those APIs here: https://docs.google.com/spreadsheets/d/1Bc32plQTswNdCqXS99deB0n7Te7FfD7uepGAOOlPbvY/edit?usp=sharing

Here are the methods:

	alert,
	crit,
	debug,
	emerg,
	error,
	fatal,
	info,
	log,
	notice,
	silly,
	trace,
	verbose,
	warn,
	warning,

Without that we need to wrap your good lib...

Offirmo avatar Dec 02 '17 22:12 Offirmo

Hey @Offirmo! Thanks 😄

I'm totally open to this—I was never quite sure which methods to include and which to omit, and it felt weird. What does your wrapper look like?

ianstormtaylor avatar Dec 02 '17 23:12 ianstormtaylor

I didn't write any wrapper. I won't need one if you add support for all methods ^^

Offirmo avatar Dec 03 '17 06:12 Offirmo

@Offirmo I don't understand. Are you plugging this into an existing logger? What is dictating which methods you use?

ianstormtaylor avatar Dec 03 '17 09:12 ianstormtaylor

I was thinking: when writing a logger like you did, why restricting oneself to a specific logging API? Why not supporting all methods and be pluggable everywhere? (i.e. drop-in replacement for console, bunyan, angular, etc.)

It's an architecture decision. Just suggesting the idea.

Offirmo avatar Dec 06 '17 00:12 Offirmo