npm package: @mimik/mim-logger
Description: Lightweight logging library for mimOE runtime environment
Author: mimik
Latest version: 1.0.0

<a name="MimLogger"></a>

## MimLogger
Logger instance

**Kind**: global class  

* [MimLogger](#MimLogger)
    * [.init(contextOrConfig)](#MimLogger+init) ⇒ [<code>MimLogger</code>](#MimLogger)
    * [.getConfig()](#MimLogger+getConfig) ⇒ <code>Object</code>
    * [._log(level, message, ...args)](#MimLogger+_log)
    * [.log(level, message, ...args)](#MimLogger+log)
    * [.error(message, ...args)](#MimLogger+error)
    * [.warn(message, ...args)](#MimLogger+warn)
    * [.info(message, ...args)](#MimLogger+info)
    * [.verbose(message, ...args)](#MimLogger+verbose)
    * [.debug(message, ...args)](#MimLogger+debug)
    * [.silly(message, ...args)](#MimLogger+silly)
    * [.flush()](#MimLogger+flush) ⇒ <code>Promise.&lt;void&gt;</code>
    * [.flushAndExit(exitCode)](#MimLogger+flushAndExit) ⇒ <code>Promise.&lt;void&gt;</code>
    * [.serializeError(err)](#MimLogger+serializeError) ⇒ <code>Object</code>

<a name="MimLogger+init"></a>

### mimLogger.init(contextOrConfig) ⇒ [<code>MimLogger</code>](#MimLogger)
Initializes the logger with context or configuration

**Kind**: instance method of [<code>MimLogger</code>](#MimLogger)  
**Returns**: [<code>MimLogger</code>](#MimLogger) - Logger instance for chaining  

| Param | Type | Description |
| --- | --- | --- |
| contextOrConfig | <code>Object</code> | mimik context object or config with env |

<a name="MimLogger+getConfig"></a>

### mimLogger.getConfig() ⇒ <code>Object</code>
Gets current configuration, refreshing from context if available

**Kind**: instance method of [<code>MimLogger</code>](#MimLogger)  
**Returns**: <code>Object</code> - Current configuration  
<a name="MimLogger+_log"></a>

### mimLogger.\_log(level, message, ...args)
Internal log method

**Kind**: instance method of [<code>MimLogger</code>](#MimLogger)  

| Param | Type | Description |
| --- | --- | --- |
| level | <code>string</code> | Log level |
| message | <code>string</code> \| <code>Object</code> | Log message or object with message property |
| ...args | <code>\*</code> | Additional arguments (metadata, correlationId) |

<a name="MimLogger+log"></a>

### mimLogger.log(level, message, ...args)
Generic log method with explicit level

**Kind**: instance method of [<code>MimLogger</code>](#MimLogger)  

| Param | Type | Description |
| --- | --- | --- |
| level | <code>string</code> | Log level |
| message | <code>string</code> \| <code>Object</code> | Log message |
| ...args | <code>\*</code> | Additional arguments |

<a name="MimLogger+error"></a>

### mimLogger.error(message, ...args)
Log error message

**Kind**: instance method of [<code>MimLogger</code>](#MimLogger)  

| Param | Type | Description |
| --- | --- | --- |
| message | <code>string</code> \| <code>Object</code> | Log message |
| ...args | <code>\*</code> | Additional arguments |

<a name="MimLogger+warn"></a>

### mimLogger.warn(message, ...args)
Log warning message

**Kind**: instance method of [<code>MimLogger</code>](#MimLogger)  

| Param | Type | Description |
| --- | --- | --- |
| message | <code>string</code> \| <code>Object</code> | Log message |
| ...args | <code>\*</code> | Additional arguments |

<a name="MimLogger+info"></a>

### mimLogger.info(message, ...args)
Log info message

**Kind**: instance method of [<code>MimLogger</code>](#MimLogger)  

| Param | Type | Description |
| --- | --- | --- |
| message | <code>string</code> \| <code>Object</code> | Log message |
| ...args | <code>\*</code> | Additional arguments |

<a name="MimLogger+verbose"></a>

### mimLogger.verbose(message, ...args)
Log verbose message

**Kind**: instance method of [<code>MimLogger</code>](#MimLogger)  

| Param | Type | Description |
| --- | --- | --- |
| message | <code>string</code> \| <code>Object</code> | Log message |
| ...args | <code>\*</code> | Additional arguments |

<a name="MimLogger+debug"></a>

### mimLogger.debug(message, ...args)
Log debug message

**Kind**: instance method of [<code>MimLogger</code>](#MimLogger)  

| Param | Type | Description |
| --- | --- | --- |
| message | <code>string</code> \| <code>Object</code> | Log message |
| ...args | <code>\*</code> | Additional arguments |

<a name="MimLogger+silly"></a>

### mimLogger.silly(message, ...args)
Log silly message

**Kind**: instance method of [<code>MimLogger</code>](#MimLogger)  

| Param | Type | Description |
| --- | --- | --- |
| message | <code>string</code> \| <code>Object</code> | Log message |
| ...args | <code>\*</code> | Additional arguments |

<a name="MimLogger+flush"></a>

### mimLogger.flush() ⇒ <code>Promise.&lt;void&gt;</code>
Flush all transports (for graceful shutdown)

**Kind**: instance method of [<code>MimLogger</code>](#MimLogger)  
<a name="MimLogger+flushAndExit"></a>

### mimLogger.flushAndExit(exitCode) ⇒ <code>Promise.&lt;void&gt;</code>
Flush all transports and exit process

**Kind**: instance method of [<code>MimLogger</code>](#MimLogger)  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| exitCode | <code>number</code> | <code>0</code> | Process exit code |

<a name="MimLogger+serializeError"></a>

### mimLogger.serializeError(err) ⇒ <code>Object</code>
Utility to serialize errors

**Kind**: instance method of [<code>MimLogger</code>](#MimLogger)  
**Returns**: <code>Object</code> - Serialized error  

| Param | Type | Description |
| --- | --- | --- |
| err | <code>Error</code> | Error to serialize |