Index
            LoggerMixin
¶
    LoggingMixin class to add logging functionality to classes.
Source code in src/cloe_nessy/logging/logger_mixin.py
                | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |  | 
            get_console_logger(level=None, log_format=None)
¶
    Adds a console logger to the class.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| level | int | None | The logging level for the console logger. | None | 
| log_format | str | None | The format for the console logger. | None | 
Returns:
| Type | Description | 
|---|---|
| Logger | The logger with the console handler. | 
Source code in src/cloe_nessy/logging/logger_mixin.py
              
            get_tabular_logger(logger_name=None, handlers=None, level=None, add_log_analytics_logger=None, add_unity_catalog_logger=None, log_type=None, workspace_id=None, shared_key=None, uc_workspace_url=None, uc_warehouse_id=None, uc_catalog_name=None, uc_schema_name=None, uc_table_name=None, uc_table_columns=None, column_split_char=DEFAULT_COLUMN_SPLIT_CHAR, key_value_split_char=DEFAULT_KEY_VALUE_SPLIT_CHAR)
¶
    Adds a tabular logger to the class.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| logger_name | str | None | The name of the logger. | None | 
| handlers | list[str] | None | The list of handlers to add. | None | 
| level | int | None | The logging level for the tabular logger. If not provided, the value from the settings will be used. | None | 
| add_log_analytics_logger | bool | None | Whether to add a LogAnalyticsHandler to the logger. If not provided, the value from the settings will be used. | None | 
| add_unity_catalog_logger | bool | None | Whether to add a UnityCatalogHandler to the logger. If not provided, the value from the settings will be used. | None | 
| log_type | str | None | The log type for the Log Analytics workspace. | None | 
| workspace_id | str | None | The workspace id for the Log Analytics workspace. If not provided, the value from the settings will be used. | None | 
| shared_key | str | None | The shared key for the Log Analytics workspace. | None | 
| uc_workspace_url | str | None | The workspace url for the Unity Catalog. If not provided, the value from the settings will be used. | None | 
| uc_warehouse_id | str | None | The warehouse id for the Unity Catalog. If not provided, the value from the settings will be used. | None | 
| uc_catalog_name | str | None | The catalog name for the Unity Catalog. If not provided, the value from the settings will be used. | None | 
| uc_schema_name | str | None | The schema name for the Unity Catalog. If not provided, the value from the settings will be used. | None | 
| uc_table_name | str | None | The table name for the Unity Catalog. | None | 
| uc_table_columns | dict[str, str] | None | The columns for the Unity Catalog Table. | None | 
| column_split_char | str | The column split character for the Log Analytics workspace and Unity Catalog. Defaults to "|". | DEFAULT_COLUMN_SPLIT_CHAR | 
| key_value_split_char | str | The key value split character for the Log Analytics workspace and Unity Catalog. Defaults to ":". | DEFAULT_KEY_VALUE_SPLIT_CHAR | 
Returns:
| Type | Description | 
|---|---|
| Logger | The logger with the added tabular handlers. | 
Source code in src/cloe_nessy/logging/logger_mixin.py
              
            should_add_log_analytics_handler(logging_settings, add_log_analytics_logger, **kwargs)
  
      staticmethod
  
¶
    Determines if a LogAnalyticsHandler should be added to the logger.
The Logger will be added if the target_log_analytics setting is set to True or if the add_log_analytics_logger
argument is set to True.
Setting target_log_analytics to False will prevent the handler from being added.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| logging_settings | LoggingSettings | The logging settings to use for the logger. | required | 
| add_log_analytics_logger | bool | None | Whether to add a LogAnalyticsHandler to the logger. | required | 
| **kwargs | Additional keyword arguments. Not used. | {} | 
Returns:
| Name | Type | Description | 
|---|---|---|
| bool | bool | True if the LogAnalyticsHandler should be added, False otherwise. | 
Source code in src/cloe_nessy/logging/logger_mixin.py
              
            should_add_unity_catalog_handler(logging_settings, add_unity_catalog_logger)
  
      staticmethod
  
¶
    Determines if a UnityCatalogHandler should be added to the logger.
The Logger will be added if the target_unity_catalog_table setting is set to True or if the add_unity_catalog_logger
argument is set to True.
Setting target_unity_catalog_table to False will prevent the handler from being added.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| logging_settings | LoggingSettings | The logging settings to use for the logger. | required | 
| add_unity_catalog_logger | bool | None | Whether to add a UnityCatalogHandler to the logger. | required | 
Returns:
| Name | Type | Description | 
|---|---|---|
| bool | bool | True if the UnityCatalogHandler should be added, False otherwise. |