Comments (5)
Prior to version 6 we had configuration piping, however it was removed as it was too difficult to reason about and maintain. Much clearer for options to not be inherited and merged, or at least leaving such to userland instead of core where they know the assumptions about merging and inheritance.
Similarly it would be handy if LogEntry could be passed down the pipe then the Browser transform could access LogEntry passed to Human().
This would be a seperate thing, however I think it would also complicate matters as we need the pipes compatible with normal node and deno piping. Perhaps human could extend the log entry rather than convert it, however performance is critical as some apps do thousands of logs in a few seconds, and extensions would still not output the expected result when piping human to say stdout.
from caterpillar.
Ok. It is interesting that I've come along after the fact and suggested something that was in place earlier. That would suggest there was and possibly still is a need. However I completely understand your position and am fine to just move on.
I've made extensive changes to copies of Human and Browser to enable all ansi colors and styles to be used everywhere, and along the way simplified the code. However the Browser output is overly noisy as all objects are expanded, which I'm not used to. This makes sense in Node, however in the Browser simpler logging lets the user interactively expand and collapse objects which presents a far more compact (less noisy) output.
So I'm now working at implementing an option for this simpler Browser logging style. However because of the loss of information piped from Human to Browser, it looks like I need to combine the two transforms into one. I'll keep you posted.
Here's my updated Browser output:
and this show's all the Log Levels:
from caterpillar.
The browser transform and the hunan transform could certainly be merged. The plan would be for an ansi package that outputs the style for the browser if in a browser environment. And either the one package does it automatically, or you configure the new human transform with the appropriate config for the environment.
from caterpillar.
Yes, I'm using ansicolor which replaces your ansi code. Works a treat.
I now have a combined human and browser module called superHuman 😀 which has target (browser/node) options amongst others. It's coming along nicely.
It can either do the original colored and expanded output or the user expandable compact output like this:
from caterpillar.
Lookin good
from caterpillar.
Related Issues (20)
- logger.log and then process.exit doesn't show anything HOT 2
- Support for additional logging calls HOT 3
- Can't access any docs etc. HOT 2
- Broken Link
- Logger metadata HOT 4
- Mystery else and assignment in human.ts HOT 2
- problem with deno sample on https://repl.it/@balupton/caterpillar-deno#index.ts HOT 4
- Only fetch line info if a new `debug` config option is true (false by default) HOT 2
- Look into flushing and see its performance impacts HOT 1
- flow type complaining with recent flow type version HOT 1
- Getting Error while running on Browser using vite package manager HOT 2
- Does default level really work? HOT 4
- update docs, usage, and examples for upcoming v6 HOT 1
- import subtree histories of the merged packages HOT 1
- LineInfo and Curriyng HOT 1
- currently not working on node due to editions#91 HOT 1
- colorize objects in deno output HOT 1
- Formatting output HOT 1
- Getting Started docs needed. HOT 7
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 caterpillar.