File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ async function botlist(client){
3030 connectBdlBot ( bldapikey . bdl , client ) . then ( r => console . log ( r ) ) ;
3131
3232 postertopgg . on ( "posted" , async ( stats ) => {
33- console . log ( "Post in Top.gg | " + stats . serverCount + " servers" ) ;
33+ client . logger . info ( "Post in Top.gg | " + stats . serverCount + " servers" ) ;
3434 await fetch (
3535 "https://discordbotlist.com/api/v1/bots/733728002910715977/stats" ,
3636 {
@@ -47,7 +47,7 @@ async function botlist(client){
4747 } )
4848 }
4949 ) . then ( async ( res ) => {
50- console . log ( "Post en DiscordBotList | " + res . status ) ;
50+ client . logger . info ( "Post en DiscordBotList | " + res . status ) ;
5151 } ) ;
5252 } ) ;
5353
Original file line number Diff line number Diff line change @@ -2,9 +2,10 @@ const express = require('express');
22const app = express ( ) ;
33
44let port = process . env . PORT || 80
5-
5+ let Client
66
77async function index ( client ) {
8+ Client = client
89 app . get ( '/api/all' , ( req , res ) => {
910 const users = { }
1011 client . users . cache . forEach ( user => {
@@ -112,7 +113,7 @@ async function index(client){
112113 } ) ;
113114}
114115app . listen ( port , ( ) => {
115- console . log ( "Server in port " + port ) ;
116+ Client . logger . info ( "Server in port " + port ) ;
116117} ) ;
117118
118119module . exports = {
Original file line number Diff line number Diff line change @@ -21,23 +21,24 @@ const logger = createLogger({
2121 level : 'debug' ,
2222 format : format . combine (
2323 format . errors ( { stack : true } ) ,
24- format . label ( { label : path . basename ( process . mainModule . filename ) } ) ,
25- format . timestamp ( { format : 'YYYY-MM-DD HH:mm:ss' } )
24+ format . label ( { label : path . basename ( require . main . filename ) } ) ,
25+ format . timestamp ( { format : '( YYYY/MM/DD) HH:mm:ss' } )
2626 ) ,
2727 transports : [
2828 // Logging to console
2929 new transports . Console ( {
3030 format : format . combine (
3131 format . colorize ( ) ,
3232 logFormat
33- )
33+ ) ,
34+ handleExceptions : true
3435 } ) ,
3536 // Logging info and up to file
3637 new transports . File ( {
3738 filename : path . join ( __basedir , 'logs/full.log' ) ,
3839 level : 'info' ,
3940 format : logFormat ,
40- options : { flags : 'w' }
41+ options : { flags : 'w' }
4142 } ) ,
4243 // Logging only warns and errors to file
4344 new transports . File ( {
You can’t perform that action at this time.
0 commit comments