3.0.0 • Published 10 years ago

thor-logs-cli v3.0.0

Weekly downloads
71
License
Proprietary
Repository
github
Last release
10 years ago

Thor logs cli

setup and help

	npm install -g thor-logs-cli
	> thor-logs --help

example

	> thor-logs list --status=pending

outputs:

{ "pending": [], "start": [ "/logs/1.log" ], end: ["/logs/2.log"], error: [] }

or

	> thor-logs list --status=pending

outputs:

{ "pending": [] }

Combine scan and splitToFiles to create the perfect input for retransmitter:

scan will output something like

{ "MobileCoreTxns": { "pending": { "files": [ array ] }, "end": { "files": [ array ] } }, "MobileCoreAdServerLoopbacks": { etc... } }

then piping it to splitToFiles will write the following files:

MobileCoreTxns.pending.json - will contain { "files": array } MobileCoreTxns.end.json MobileCoreAdserverLoopbacks.pending.json etc...

it will also print all the files that it created to the console like so:

{ "files": [ "/path/to/MobileCoreTxns.pending.json", .... etc ] }

reuse list functionality

var cli = require('thor-logs-cli')

// targetPath - path to files
// extension - the base extension, e.g 1.log.active, 1.log.end, so log is the extension
// match - a string to match in all the returned files
// statusFiles - an array of statuses to include, [ 'pending', 'end'] will return { pending: [...files...], end: [...files] }
// 				if one status is specified, then the json will be { files: [] }
// includeEmptyFiles - whether to return empty log files or not
// files - an array of files in the path (e.g the result of fs.readdir call)

cli.list(targetPath, extension, match, statusFilter, includeEmptyFiles, files)
3.0.0

10 years ago

2.3.7

10 years ago

2.3.6

10 years ago

2.3.5

10 years ago

2.3.4

10 years ago

2.3.3

10 years ago

2.3.2

10 years ago

2.3.1

10 years ago

2.1.0

10 years ago

2.0.3

10 years ago

2.0.2

10 years ago

2.0.1

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago