haadcode / logplease Goto Github PK
View Code? Open in Web Editor NEWSimple Javascript logger for Node.js and Browsers
License: MIT License
Simple Javascript logger for Node.js and Browsers
License: MIT License
This previous change to allow colors to work in an electron renderer process had an unintended side effect of preventing electron renderer processes from writing to file. Since they are still node processes I think that functionality should be preserved.
Hi.
When I try to run yarn build
in my own project I get this error:
`$ yarn build
yarn run v1.9.4
$ react-scripts build
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/logplease/src/index.js:7
Read more here: http://bit.ly/2tRViJ9
error Command failed with exit code 1.
`
Following the above link React recommend some actions to take. Are those recommendations valid?
Are you able to publish logplease pre-compiled?
Thanks
Bård
Add to webpack.config.js / resolve.alias:
fs: require.resolve('./node_modules/logplease/src/fs-mock'),
It would be great to run the tests in the browser too.
This should be fairly straight-forward to add, so if anyone wants to PR this, I'd be happy to help to get it merged.
Steps to reproduce:
renderer.js
and add the following linesconst Logger = require('logplease');
const log = Logger.create('[example]');
log.info('Colors should renderer properly in electron browser window');
main.js
and uncomment the line that says mainWindow.webContents.openDevTools()
Expected:
Log should have appropriate colors
Actual:
Log appears to be trying to use terminal style colors
In documentation you mentioned it is possible to "Log messages to stdout or a file".
How can I disable logging to stdout/console?
Thank you.
If yes, please provide example how to do it.
That is, when I do a try catch, I want to log the "e" of the try catch. I can create two log messages in a row like this but the second one is unlabled which is confusing. I can't use JSON.stringify because of circular reference errors.
} catch (e) {
logger.error(`server.ts:getSessionUrls errored:${e.message}`);
logger.error(e);
}
Hi! First of all, thank you for this great library!
We are using your library on a package of our own, and we have customers that download our library from NPM with yours as a dep.
Thing is that some people have applications that doesn't always run on environments with ES6 support. As your main file contains ES6 code, the require of logplease is causing issues to them.
Would you mind if I submit a PR adding a build with the transpiling? I can also update the webpack configs to work with Webpack 2 in the process (and of course, I'll update the docs).
This is a great library and we don't want to move away just for this tiny issue.
Thanks in advance!
Need to comment out uglify plugin for now:
// new webpack.optimize.UglifyJsPlugin(),
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.