Comments (7)
Yes, this has been nagging me too! There is an attempted failsafe to no-op if the console logger is missing.
Can we clarify exactly what the bug is?
- Some browsers are not working because
console
is not defined? - The failsafe (which replaces
console.log()
etc. with no-op functions) is not working correctly? - The whole idea is dangerous and logging should be opt-in?
Frankly I can see an argument for any of these options. What would you prefer, @perezd?
from browser-request.
Actually I patched this in my branch. I export the logger and allow the caller to redefine it. Should I send you a pull request?
https://github.com/perezd/browser-request/commit/bf519d5586e6c433258ed3e5b2837b2ab905a753
from browser-request.
Awesome, yes please send a pull req.
from browser-request.
i wish browser request conformed to the unix law of "silence is golden":
When a program has nothing surprising to say, it should say nothing
e.g. logging should be off by default
from browser-request.
Agreed. Jason also has a habit of using Log4Js or whatever the hell and it monkey patches console.xxx. I hate that shit.
from browser-request.
First of all, if the logging activities break any browser, that is a bug. Please let me know.
I still prefer log4js, which no longer automatically monkey-patches console. However I now regret all logger usage in all my libraries. Logging is becoming a pain point.
In my new code, I now have a "log" object (defaults to console
) and I assume it has the same API as console
. So I call .log()
, .info()
, etc. The programmer can replace that with whatever logger they want, as long as it has the same API.
from browser-request.
@perezd I believe this issue corresponds with pull request #8 which I merged.
from browser-request.
Related Issues (20)
- Basic Auth Base64 endocding
- json:true should parse the response to json object HOT 1
- json:true writes to body even if there's nothing to write
- Not support bearer authentication HOT 1
- Content-Type is application/json,application/json
- request module work in browser HOT 1
- Request works in Chrome, fails in Firefox with "CORS request rejected" error HOT 2
- default baseUrl is not working
- formData not supported HOT 4
- IE11 InvalidErrorStatus HOT 2
- Unexpected end of JSON input - Offline mode HOT 1
- Does your library support cookies?
- Refused to set unsafe header "User-Agent"
- Typescript support HOT 1
- Uncaught error, no options given
- Simple way to make a request sync? HOT 1
- window.request is undefined
- Support proxy option
- Is anyone still maintaining this library? HOT 4
- Sending an image file using the form? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from browser-request.