
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
JSON logging & reporting inspired by Loggly.
$ npm install jog
Write to the logs:
log.write(level, msg[, obj])
log.debug(msg[, obj])
log.info(msg[, obj])
log.warn(msg[, obj])
log.error(msg[, obj])
Namespace with the given obj, returning a new Jog instance
inheriting previous properties. You may call this several times
to produce more and more specific loggers.
var log = jog(new jog.FileStore('/tmp/log));
// log a user 5
log = log.ns({ uid: 5 });
// log video id 99 for user 5
log = log.ns({ vid: 99 });
// or both at once
log = log.ns({ uid: 5, vid: 99 });
Return an EventEmitter emitting "data" and "end" events.
end when false streaming will not endinterval the interval at which to poll (store-specific)Clear the logs and invoke the callback.
Log random data using the FileStore and tail the file
for changes (typically in different processes). Jog will add
the .level and .msg properties for you.
var jog = require('jog')
, log = jog(new jog.FileStore('/tmp/tail'))
, id = 0;
// generate random log data
function again() {
log.info('something happened', { id: ++id, user: 'Tobi' });
setTimeout(again, Math.random() * 100 | 0);
}
again();
// tail the json "documents"
log.stream({ end: false, interval: 500 })
.on('data', function(obj){
console.log(obj);
});
yields:
{ id: 1,
level: 'info',
msg: 'something happened',
timestamp: 1332907641734 }
{ id: 2,
level: 'info',
msg: 'something happened',
timestamp: 1332907641771 }
...
Usage: jog [options]
Options:
-h, --help output usage information
-V, --version output the version number
-F, --file <path> load from the given <path>
-R, --redis load from redis store
-s, --select <fn> use the given <fn> for filtering
-m, --map <fn> use the given <fn> for mapping
-c, --color enable colors for json output
View all logs from tobi. The _ object for the function
bodies of --select and --map represents the current
document, it's all just javascript.
jog --file /tmp/jog --select "_.user == 'tobi'"
[ { user: 'tobi',
duration: 1000,
level: 'info',
msg: 'rendering video',
timestamp: 1332861272100 },
{ user: 'tobi',
duration: 2000,
level: 'info',
msg: 'compiling video',
timestamp: 1332861272100 },
...
Filter video compilation durations from "tobi" only:
$ jog --file /var/log/videos.log --select "_.user == 'tobi'" --map _.duration
[ 1000, 2000, 1200, 1000, 2000, 1200 ]
The --map flag can be used several times:
jog --file /var/log/videos.log --select "_.vid < 5" --map _.msg --map "_.split(' ')"
[ [ 'compiling', 'video' ],
[ 'compiling', 'video' ],
[ 'compiling', 'video' ],
[ 'compiling', 'video' ] ]
By default Jog ships with the FileStore and RedisStore, however anything
with the following methods implemented will work:
- `add(obj)` to add a log object
- `stream() => EventEmitter` to stream data
- `stream({ end: false }) => EventEmitter` to stream data indefinitely
- `clear(fn)` to clear the logs
Store logs on disk.
var jog = require('jog');
var log = jog(new jog.FileStore('/var/log/videos.log'));
Store logs in redis.
var jog = require('jog');
var log = jog(new jog.RedisStore);
$ npm install
$ make test
(The MIT License)
Copyright (c) 2012 LearnBoost <tj@learnboost.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
JSON logging & reporting
The npm package jog receives a total of 90 weekly downloads. As such, jog popularity was classified as not popular.
We found that jog demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.