mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 07:24:13 +00:00 
			
		
		
		
	chore(backend/logger): log data for every level if exists (#12863)
This commit is contained in:
		
							parent
							
								
									5498ec57d0
								
							
						
					
					
						commit
						09aba4cf16
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
					@ -71,8 +71,11 @@ export default class Logger {
 | 
				
			||||||
		let log = `${l} ${worker}\t[${contexts.join(' ')}]\t${m}`;
 | 
							let log = `${l} ${worker}\t[${contexts.join(' ')}]\t${m}`;
 | 
				
			||||||
		if (envOption.withLogTime) log = chalk.gray(time) + ' ' + log;
 | 
							if (envOption.withLogTime) log = chalk.gray(time) + ' ' + log;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		console.log(important ? chalk.bold(log) : log);
 | 
							const args: unknown[] = [important ? chalk.bold(log) : log];
 | 
				
			||||||
		if (level === 'error' && data) console.log(data);
 | 
							if (data != null) {
 | 
				
			||||||
 | 
								args.push(data);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							console.log(...args);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@bindThis
 | 
						@bindThis
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue