cclog ccinfo ccerr ccwarn
This commit is contained in:
		
							parent
							
								
									cfb66c3eec
								
							
						
					
					
						commit
						6822930e78
					
				
							
								
								
									
										13
									
								
								tool4log.js
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								tool4log.js
									
									
									
									
									
								
							@ -1,7 +1,16 @@
 | 
			
		||||
const colors = require('colors')
 | 
			
		||||
 | 
			
		||||
module.exports = {
 | 
			
		||||
  colog(...args) {
 | 
			
		||||
  cclog(...args) {
 | 
			
		||||
    console.log(colors.green({time: new Date().toJSON()}), ...args)
 | 
			
		||||
  }
 | 
			
		||||
  },
 | 
			
		||||
  ccinfo(...args) {
 | 
			
		||||
    console.info(colors.blue({time: new Date().toJSON()}), ...args)
 | 
			
		||||
  },
 | 
			
		||||
  ccerr(...args) { // console.error will appear in pm2's error log
 | 
			
		||||
    console.error(colors.red({time: new Date().toJSON()}), ...args)
 | 
			
		||||
  },
 | 
			
		||||
  ccwarn(...args) { // console.warn will appear in pm2's error log
 | 
			
		||||
    console.warn(colors.yellow({time: new Date().toJSON()}), ...args)
 | 
			
		||||
  },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user