MCPcopy Index your code
hub / github.com/Olian04/better-logging

github.com/Olian04/better-logging @5.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 5.0.0 ↗ · + Follow
42 symbols 85 edges 41 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

NPM Version Supported Types NPM Downloads Build Status Master Build Status Dev LICENSE FOSSA Status

better-logging

demo output of better-logging in action

Out of the box Javascript comes five different standardized logging types. However, as it stands only browsers are taking advantage of these different methods of logging. better-logging aims to improve the default logging experience of any node application, it is designed to be a drop in replacement for the default logging methods.

Since better-logging only decorates the default logging methods you won't lose any functionality provided by other tooling. better-logging is not meant to be the be all and end all of node.js logging. It is just supposed to increase the usefulness of the default logging methods.

Install: npm i better-logging


// Default in node.js
console.debug('foo'); //  foo
console.log('foo'); //    foo
console.info('foo'); //   foo
console.warn('foo'); //   foo
console.error('foo'); //  foo

// With better-logging
require('better-logging')(console);

console.debug('foo'); //  [11:46:35.294] [debug] foo
console.log('foo'); //    [11:46:35.296] [log] foo
console.info('foo'); //   [11:46:35.296] [info] foo
console.warn('foo'); //   [11:46:35.298] [warn] foo
console.error('foo'); //  [11:46:35.298] [error] foo
console.line('foo'); //   foo

Documentation

https://olian04.gitbook.io/better-logging/

License

See LICENSE

FOSSA Status

Extension points exported contracts — how you extend this code

Console (Interface)
(no doc)
src/api.ts
LogFunctionMap (Interface)
(no doc)
src/lib/interfaces/logFunctionMap.ts
IMiddlewareConfigProperty (Interface)
(no doc)
src/express/index.ts
Theme (Interface)
(no doc)
src/lib/interfaces/theme.ts
IConfig (Interface)
(no doc)
src/express/index.ts
FormattingContext (Interface)
(no doc)
src/lib/interfaces/formattingContext.ts
IExpressRequest (Interface)
(no doc)
src/express/index.ts
DecoratedInstance (Interface)
(no doc)
src/lib/interfaces/decoratedInstance.ts

Core symbols most depended-on inside this repo

CustomInstance
called by 7
src/api.ts
resolveConfig
called by 5
src/lib/config.ts
STAMP
called by 5
src/lib/formatMessage.ts
formatMessage
called by 5
src/lib/formatMessage.ts
funcFactory
called by 5
src/lib/decorateObject.ts
expressMiddleware
called by 2
src/express/index.ts
writeLogToFile
called by 1
src/lib/writeToFile.ts
decorate
called by 1
src/lib/logger.ts

Shape

Function 22
Interface 9
Class 6
Method 4
Enum 1

Languages

TypeScript100%

Modules by API surface

test/integration-tests/log-object.test.js5 symbols
src/lib/logger.ts5 symbols
src/lib/formatMessage.ts5 symbols
src/express/index.ts4 symbols
src/lib/config.ts3 symbols
test/integration-tests/multiple-implementation-ojects.test.js2 symbols
src/lib/decorateObject.ts2 symbols
src/lib/configCache.ts2 symbols
src/api.ts2 symbols
test/integration-tests/theme.test.js1 symbols
test/integration-tests/message-construction-strategy.test.js1 symbols
test/integration-tests/custom-log-levels.test.js1 symbols

For agents

$ claude mcp add better-logging \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact