This repository is now obsolete and not maintained, in favour of main DevSubmarine Discord Bot.
The official DevSubmarine Discord Bot!
Features lots of funny and silly commands to create a better user experience overall!
The bot is set up to use Winston for logs, but has customized configuration loading, allowing changing logging behaviour inside of settings.json file.
The logging is set up inside of Logging
object property of settings file. If the property is missing, bot will set up simple logging to Console with 'verbose' level
by default.
The Logging
object can have few properties, which will be used when configuring Winston.
level
- specifies the default logging level for all transports;exitOnError
- whether unhandled exceptions should cause bot to exitsilent
- will surpress all logs
Additionally, at least one transport needs to be configured for logging to work. Transports can be configured with transports
array inside of Logging
object. Each element of the array should be an object - each object represents one transport.
One property is required in each transport: TransportType
. This property is used to tell configuration loader which Winston transport to pick. Currently, the bot supports 3 transport types:
Besides TransportType
, some transport may require additional properties. All properties besides TransportType
will be passed as-is to Winston transport object.
Please refer to Winston Transports docs for configuration details for each transport type.
Logging configuration example can be found in settings.example.json file.
To log from separate file, simply require the logging.js (might require ..
etc if the file is in a folder).
var Log = require('./logging.js')
Log.info('My special log message');
For more information, refer to Winston Logging docs.