[API Reference](../README.md) > [LoggingService](../classes/LoggingService.md)



# Class: LoggingService


Provides logging support, logging by default to the JavaScript console. You can provide alternate or additional loggers by using `LoggingService.addLogger` and `LoggingService.removeLogger`.

You can set the `LogLevel` by setting `LoggingService.logLevel` with flags from [LogLevel](/api/enums/LogLevel/) or by using the [ConfigService](Configuration#logging).

Logically, LogLevels are simply or'd together, there is no hierarchy to them.

## Index

### Properties

* [logLevel](LoggingService.md#logLevel)
* [loggers](LoggingService.md#loggers)
* [moduleName](LoggingService.md#moduleName)


### Methods

* [addLogger](LoggingService.md#addLogger)
* [debug](LoggingService.md#debug)
* [error](LoggingService.md#error)
* [info](LoggingService.md#info)
* [message](LoggingService.md#message)
* [removeLogger](LoggingService.md#removeLogger)
* [stringifyObject](LoggingService.md#stringifyObject)
* [warn](LoggingService.md#warn)



---
## Properties
<a id="logLevel"></a>

### «Static» logLevel

**●  logLevel**:  *[LogLevel](../enums/LogLevel.md)*  =  LogLevel.none

*Defined in [loggingService.ts:72](https://github.com/daostack/arc.js/blob/f343aa24/lib/loggingService.ts#L72)*





___

<a id="loggers"></a>

### «Static» loggers

**●  loggers**:  *`Array`.<[ILogger](../interfaces/ILogger.md)>*  =  [new ConsoleLogger()]

*Defined in [loggingService.ts:70](https://github.com/daostack/arc.js/blob/f343aa24/lib/loggingService.ts#L70)*





___

<a id="moduleName"></a>

### «Static» moduleName

**●  moduleName**:  *`string`*  = "Arc.js"

*Defined in [loggingService.ts:74](https://github.com/daostack/arc.js/blob/f343aa24/lib/loggingService.ts#L74)*





___


## Methods
<a id="addLogger"></a>

### «Static» addLogger

► **addLogger**(logger: *[ILogger](../interfaces/ILogger.md)*): `void`



*Defined in [loggingService.ts:145](https://github.com/daostack/arc.js/blob/f343aa24/lib/loggingService.ts#L145)*



**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| logger | [ILogger](../interfaces/ILogger.md)   |  - |





**Returns:** `void`





___

<a id="debug"></a>

### «Static» debug

► **debug**(message: *`string`*): `void`



*Defined in [loggingService.ts:76](https://github.com/daostack/arc.js/blob/f343aa24/lib/loggingService.ts#L76)*



**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| message | `string`   |  - |





**Returns:** `void`





___

<a id="error"></a>

### «Static» error

► **error**(message: *`string`*): `void`



*Defined in [loggingService.ts:94](https://github.com/daostack/arc.js/blob/f343aa24/lib/loggingService.ts#L94)*



**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| message | `string`   |  - |





**Returns:** `void`





___

<a id="info"></a>

### «Static» info

► **info**(message: *`string`*): `void`



*Defined in [loggingService.ts:82](https://github.com/daostack/arc.js/blob/f343aa24/lib/loggingService.ts#L82)*



**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| message | `string`   |  - |





**Returns:** `void`





___

<a id="message"></a>

### «Static» message

► **message**(message: *`string`*, level?: *[LogLevel](../enums/LogLevel.md)*): `void`



*Defined in [loggingService.ts:117](https://github.com/daostack/arc.js/blob/f343aa24/lib/loggingService.ts#L117)*



Log a message at potentially multiple levels instead of just one.

The message will be logged just once, at the first log level in the intersection between the given log level and the current log level, in the following order of precendence:

1.  error
2.  warn
3.  info
4.  debug

So if the current log level is info|error and you call `message("a message", LogLevel.info|LogLevel.error)` then you will see the message logged as an error.


**Parameters:**

| Param | Type | Default value | Description |
| ------ | ------ | ------ | ------ |
| message | `string`  | - |   - |
| level | [LogLevel](../enums/LogLevel.md)  |  LoggingService.logLevel |   log level(s) |





**Returns:** `void`





___

<a id="removeLogger"></a>

### «Static» removeLogger

► **removeLogger**(logger: *[ILogger](../interfaces/ILogger.md)*): `void`



*Defined in [loggingService.ts:149](https://github.com/daostack/arc.js/blob/f343aa24/lib/loggingService.ts#L149)*



**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| logger | [ILogger](../interfaces/ILogger.md)   |  - |





**Returns:** `void`





___

<a id="stringifyObject"></a>

### «Static» stringifyObject

► **stringifyObject**(obj: *`any`*): `string`



*Defined in [loggingService.ts:156](https://github.com/daostack/arc.js/blob/f343aa24/lib/loggingService.ts#L156)*



**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| obj | `any`   |  - |





**Returns:** `string`





___

<a id="warn"></a>

### «Static» warn

► **warn**(message: *`string`*): `void`



*Defined in [loggingService.ts:88](https://github.com/daostack/arc.js/blob/f343aa24/lib/loggingService.ts#L88)*



**Parameters:**

| Param | Type | Description |
| ------ | ------ | ------ |
| message | `string`   |  - |





**Returns:** `void`





___


