latentflip / bows Goto Github PK
View Code? Open in Web Editor NEWSafe, production happy, colourful logging for chrome & firefox - makes reading your logs much easier.
Home Page: http://latentflip.com/bows/
Safe, production happy, colourful logging for chrome & firefox - makes reading your logs much easier.
Home Page: http://latentflip.com/bows/
When using webpack and babel-loader the missing comma in bows.js is causing an issue.
The code:
var inNode = typeof window === 'undefined',
ls = !inNode && window.localStorage,
debugKey = ls.andlogKey || 'debug',
debug = ls[debugKey],
logger = require('andlog'),
bind = Function.prototype.bind,
hue = 0,
padLength = 15,
noop = function() {},
colorsSupported = ls.debugColors || checkColorSupport(),
bows = null,
debugRegex = null,
invertRegex = false
moduleColorsMap = {};
transforms to
var inNode = typeof window === 'undefined',
ls = !inNode && window.localStorage,
debugKey = ls.andlogKey || 'debug',
debug = ls[debugKey],
logger = require('andlog'),
bind = Function.prototype.bind,
hue = 0,
padLength = 15,
noop = function() {},
colorsSupported = ls.debugColors || checkColorSupport(),
bows = null,
debugRegex = null,
invertRegex = false;
moduleColorsMap = {};
Causing an "Uncaught ReferenceError: moduleColorsMap is not defined"
there should be a comma after invertRegex = false
Do you think it would be possible to tag (at least the latest version 0.3.0
) in the repo?
This would allow, among other things, to install with Bower, or even do something like:
curl -o vendor/bows.js https://raw.github.com/latentflip/bows/0.3.0/dist/bows.js
Thanks!
Set padLength to 100, but module name is still truncated.
In
Line 29 in 334d8a6
ls
can be null. So then the next line throws an exception like Cannot read property 'andlogKey' of null
This line may need to be something like
debugKey = (ls && ls.andlogKey) || 'debug',
Thanks
Not that it would cause any problems per se, but it might be best to set localStorage.bowsDebug
to avoid colliding with the more generic localStorage.debug
.
Great module, btw. Really enjoying it.
The current implementation of console.log
allows you to pass it many arguments that you may wish to log...
console.log(string, array, object);
This is really nice because it lets you log many "types" in one function call. It also prevents you from needing to concatenate strings. I just thought it might be nice to have on the roadmap for this project... Which is really great as it stands!
Not force it from the localStorage.debug
Exemple:
bows.config({
padLength: 10,
debug: /foo/g
});
I'm curious if there's a way to enable specific logs rather than all logging.
for example:
var bows = require('bows');
var personLogs = bows('person');
var companyLogs = bows('company')
Is there a way to specify that I only want to see company logs and not person logs? In the browser I can filter of course, but I'm looking for a way to do this in node. the npm debug package allows me to pass in --debug='company' for example, is there anything like that in bows?
I really like bows, the only thing I'm missing is an optional way to observe the time spent between two calls of the same "resource". Just like debug
s implementation.
Hi, I m evaluating console wrapper scripts, and I need the exact line numbers to be logged in console, instead of some line number of wrapper library code. This 'bows' seems logging correct line numbers.
But, can someone clarify the browser support? Readme says 'Works in all reasonable browsers', which is not clear.
In IE8, I m getting below error: (via IE11, document mode emulation)
(I m using Windows Pro 8.1, IE 11)
SCRIPT445: Object doesn't support this action
File: bows.js, Line: 57, Column: 7
logfn = logger.log.bind(logger, msg);
Thanks.
I'm using this awesome logger and then I realised that I cannot disable the logger setting the flag localStorage.debug
to false
. After the first time you set up this flag to true
it'll remain until you clear your localStorage
so, I think, that would be nice that the false
value just run a simple localStorage.removeItem('debug')
.
Just saying, nice job by the way.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.