Log new command being registered
This commit is contained in:
		
							parent
							
								
									7ccd17d64b
								
							
						
					
					
						commit
						fc6c503a47
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		|  | @ -1,4 +1,5 @@ | ||||||
| import inspect | import inspect | ||||||
|  | import logging | ||||||
| import sys | import sys | ||||||
| 
 | 
 | ||||||
| from pathlib import Path | from pathlib import Path | ||||||
|  | @ -9,6 +10,8 @@ from . import const, vt100 | ||||||
| 
 | 
 | ||||||
| Value = Union[str, bool, int] | Value = Union[str, bool, int] | ||||||
| 
 | 
 | ||||||
|  | _logger = logging.getLogger(__name__) | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| class Args: | class Args: | ||||||
|     opts: dict[str, Value] |     opts: dict[str, Value] | ||||||
|  | @ -86,6 +89,7 @@ def command(shortName: Optional[str], longName: str, helpText: str): | ||||||
|     calframe = inspect.getouterframes(curframe, 2) |     calframe = inspect.getouterframes(curframe, 2) | ||||||
| 
 | 
 | ||||||
|     def wrap(fn: Callable[[Args], None]): |     def wrap(fn: Callable[[Args], None]): | ||||||
|  |         _logger.debug(f"Registering command {longName}") | ||||||
|         commands.append( |         commands.append( | ||||||
|             Command( |             Command( | ||||||
|                 shortName, |                 shortName, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue