@plastichub/osr-log
Version:
Package basics
18 lines • 1.25 kB
JSON
[
{
"level": "info",
"message": {
"content": "Here's the modified code with logging flags:"
},
"timestamp": "2024-12-28T16:32:28.814Z",
"service": "collector:onContent"
},
{
"level": "info",
"message": {
"content": "\n\nUsage example:\n\n```typescript\n// Create a logger with all transports enabled\nconst logger = winstonLogger('MyApp', 'app-logs', {\n enableConsole: true,\n enableJsonFile: true,\n enableTextFile: true,\n enableSeq: true,\n seqConfig: {\n serverUrl: 'https://localhost:5341',\n apiKey: 'your-api-key'\n }\n});\n\n// Create a logger with only console and JSON file\nconst simpleLogger = winstonLogger('SimpleApp', 'simple-logs', {\n enableConsole: true,\n enableJsonFile: true\n});\n```\n\nThe changes include:\n1. Added LoggerOptions interface to control which transports are enabled\n2. Modified winstonLogger to accept LoggerOptions parameter\n3. Made all transports optional and controlled by flags\n4. Separated JSON and text file logging into different options\n5. Made Seq transport configurable through options\n6. Improved file naming for different transport types"
},
"timestamp": "2024-12-28T16:32:34.540Z",
"service": "collector:onContent"
}
]