Comments (3)
Heh, I had these (in separate places) in my notes:
bunyan -s|--start 5m # start 5 min ago
bunayn -s time=5m
The idea with the latter one is a more generic "start" option that would potentially eventually allow something like this:
bunyan -s req_id=$uuid
That would scan back through the log file(s) looking for the first record with that req_id
field (with some max time/num-records/size back as a guard).
Anyway, that is vapourware, so ignoring.
your proposal
bunyan -t 5s
bunayn -t 5 # presumption is 5 *seconds*
What about this to get the last N lines:
bunyan -t 5l # that's a lowercase "L"; last 5 *lines*
RobG recently added napictl lastlog
to get the last N logs, so there is a valid use case there I think. And if we did add support for this, what about (a) the mnemonic is not "time", but "tail", and (b) the default would be lines. The "l" is weird as a suffix, so I'd just drop that.
bunyan --tail # last 10 lines (where by "lines" I mean log records)
bunyan -t # ditto
bunyan -t 5 # last 5 lines
bunyan -t 5s # last 5 seconds
bunyan -t 5m # last 5 minutes
Thoughts?
Also, your patch was clipped at 80 columns, cutting off some of your usage text. Can you resubmit that?
from node-bunyan.
FWIW I made this little utility for myself: https://github.com/chakrit/bunyan-reltime
from node-bunyan.
@chakrit Nice! Thanks for the note.
from node-bunyan.
Related Issues (20)
- Serializer on error and custom fields
- Does bunyan depend on log4j? HOT 2
- Add extra metada into log record HOT 1
- Create SECURITY.md
- Bunyan CLI weirdly suppresses output from node's `readline.prompt()` - `mute-stream` and `read` therefore don't work correctly with bunyan HOT 2
- How do I specify the parent caller as the path to log out when `src` is enabled? HOT 1
- Transform stream/`.pipe` are not working as expected
- Verify high CPU usage on journald HOT 1
- Update version of moment to fix CVE-2022-24785
- How can I get logLevels to show as String values like INFO instead of 30 in the log file ? HOT 1
- Update version of moment to fix GHSA-wc69-rhjr-hc9g (CVE-2022-31129) HOT 8
- `v` always 0 despite bunyan version 1.x released and version 2.x in the making HOT 1
- Inconsistent behaviour on Windows with PowerShell
- provide credentials by passing the username and password parameters for elastic user
- Handle non-function `cause` field in error serializer HOT 3
- Bunyan fails to log 'src' when running in Node 20 versus Node 18
- Change time zone to local time in createLogger
- Next.js middleware runtime not supported HOT 4
- Provide capability to redact sensitive information HOT 1
- Remove/replace dependency on MV HOT 3
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 node-bunyan.