30 lines
		
	
	
		
			823 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			823 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { commitinfo } from '@push.rocks/commitinfo';
 | |
| import * as plugins from './plugins.js';
 | |
| 
 | |
| // Create logger instance
 | |
| export const logger = plugins.smartlog.Smartlog.createForCommitinfo(commitinfo);
 | |
| 
 | |
| // Add console destination
 | |
| const consoleDestination =
 | |
|   new plugins.smartlogDestinationLocal.DestinationLocal();
 | |
| logger.addLogDestination(consoleDestination);
 | |
| 
 | |
| // Verbose logging helper
 | |
| let verboseMode = false;
 | |
| 
 | |
| export const setVerboseMode = (verbose: boolean): void => {
 | |
|   verboseMode = verbose;
 | |
|   logger.log('info', `Verbose mode ${verbose ? 'enabled' : 'disabled'}`);
 | |
| };
 | |
| 
 | |
| export const isVerboseMode = (): boolean => {
 | |
|   return verboseMode;
 | |
| };
 | |
| 
 | |
| // Custom log method with verbose support
 | |
| export const logVerbose = (message: string): void => {
 | |
|   if (verboseMode) {
 | |
|     logger.log('info', `[VERBOSE] ${message}`);
 | |
|   }
 | |
| };
 |