<commit_before><p align="center">
  <a href="https://app.logdna.com">
    <img height="95" width="201" src="https://raw.githubusercontent.com/logdna/artwork/master/logo%2Bnode.png">
  </a>
  <p align="center">Python package for logging to <a href="https://app.logdna.com">LogDNA</a></p>
</p>

===

* **[Install](#install)**
* **[Setup](#setup)**
* **[Usage](#usage)**
* **[API](#api)**
* **[License](#license)**


## Install

```bash
$ pip install logdna
```

## Setup
```python
import logging
from logdna import LogDNAHandler

key = 'YOUR API KEY HERE'

log = logging.getLogger('logdna')
log.setLevel(logging.INFO)

options = {
  'hostname': 'pytest'
}

# Defaults to false, when true ensures meta object will be searchable
options['index_meta'] = True;

test = LogDNAHandler(key, options)

log.addHandler(test)

log.warn("Warning message", {'app': 'bloop'})
log.info("Info message")

```
_**Required**_
* [LogDNA API Key](https://app.logdna.com/manage/profile)

_**Optional**_
* Hostname - *(String)* - max length 32 chars
* MAC Address - *(String)*
* IP Address - *(String)*
* Max Length - *(Boolean)* - formatted as options.max_length
* Index Meta - *(Boolean)* - formatted as options.index_meta

## Usage

After initial setup, logging is as easy as:
```javascript
// Simplest use case
log.info('My Sample Log Line');

// Add a custom level
log,info('My Sample Log Line', { 'level': MyCustomLevel' });

// Include an App name with this specific log
log.info('My Sample Log Line', { level: 'Warn', app: 'myAppName'});

// Pass any associated objects along for context
var context = {
    foo: 'bar',
    nested: {
      nest1: 'nested text'
    }
}

var opts = {
  level: 'warn',
  context: context
}

log.info('My Sample Log Line', opts);
```
## API

### LogDNAHandler(key, [options])

#### key

_**Required**_
Type: `String`
Values: `YourAPIKey`

The [LogDNA API Key](https://app.logdna.com/manage/profile) associated with your account.

#### options

##### app

_**Optional**_<commit_msg>Version 1.0.0 of LogDNA's python package -edits<commit_after><p align="center">
  <a href="https://app.logdna.com">
    <img height="95" width="201" src="https://raw.githubusercontent.com/logdna/artwork/master/logo%2Bnode.png">
  </a>
  <p align="center">Python package for logging to <a href="https://app.logdna.com">LogDNA</a></p>
</p>

===

* **[Install](#install)**
* **[Setup](#setup)**
* **[Usage](#usage)**
* **[API](#api)**
* **[License](#license)**


## Install

```bash
$ pip install logdna
```

## Setup
```python
import logging
from logdna import LogDNAHandler

key = 'YOUR API KEY HERE'

log = logging.getLogger('logdna')
log.setLevel(logging.INFO)

options = {
  'hostname': 'pytest'
}

# Defaults to false, when true ensures meta object will be searchable
options['index_meta'] = True;

test = LogDNAHandler(key, options)

log.addHandler(test)

log.warn("Warning message", {'app': 'bloop'})
log.info("Info message")

```
_**Required**_
* [LogDNA API Key](https://app.logdna.com/manage/profile)

_**Optional**_
* Hostname - *(String)* - max length 32 chars
* MAC Address - *(String)*
* IP Address - *(String)*
* Max Length - *(Boolean)* - formatted as options.max_length
* Index Meta - *(Boolean)* - formatted as options.index_meta

## Usage

After initial setup, logging is as easy as:
```javascript
# Simplest use case
log.info('My Sample Log Line');

# Add a custom level
log.info('My Sample Log Line', { 'level': MyCustomLevel' });

# Include an App name with this specific log
log.info('My Sample Log Line', { level: 'Warn', app: 'myAppName'});

# Pass any associated objects along for context
var context = {
    foo: 'bar',
    nested: {
      nest1: 'nested text'
    }
}

var opts = {
  level: 'warn',
  context: context
}

log.info('My Sample Log Line', opts);
```
## API

### LogDNAHandler(key, [options])

#### key

_**Required**_
Type: `String`
Values: `YourAPIKey`

The [LogDNA API Key](https://app.logdna.com/manage/profile) associated with your account.

#### options

##### app

_**Optional**_
{'fraction_non_alphanumeric': 0.1871577899452464, 'fraction_numerical': 0.005226480836236934, 'mean_word_length': 4.468027210884354, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '31952', 'n_tokens_mistral': 1422, 'n_tokens_neox': 1336, 'n_words': 381}