# Interface PrettyOptions

interface PrettyOptions {
hideObject?: boolean;
translateTime?: string | boolean;
levelFirst?: boolean;
levelKey?: string;
levelLabel?: string;
messageKey?: string;
singleLine?: boolean;
timestampKey?: string;
minimumLevel?: Level;
messageFormat?: string | false | MessageFormatFunc;
colorize?: boolean;
colorizeObjects?: boolean;
crlf?: boolean;
errorLikeObjectKeys?: string[];
errorProps?: string;
ignore?: string;
include?: string;
sync?: boolean;
destination?:
| string
| number
| DestinationStream
| WritableStream;
append?: boolean;
mkdir?: boolean;
customPrettifiers?: Record<string, Prettifier<object>> & {
level?: Prettifier<LevelPrettifierExtras>;
};
customLevels?: string | object;
customColors?: string | object;
useOnlyCustomProps?: boolean;
}

- Defined in node_modules/pino-pretty/index.d.ts:38

#####
Index

### Properties

hideObject?
translateTime?
levelFirst?
levelKey?
levelLabel?
messageKey?
singleLine?
timestampKey?
minimumLevel?
messageFormat?
colorize?
colorizeObjects?
crlf?
errorLikeObjectKeys?
errorProps?
ignore?
include?
sync?
destination?
append?
mkdir?
customPrettifiers?
customLevels?
customColors?
useOnlyCustomProps?

##
Properties

### `Optional` hideObject

hideObject?: boolean

Hide objects from output (but not error object).

#### Default

    false

- Defined in node_modules/pino-pretty/index.d.ts:43

### `Optional` translateTime

translateTime?: string | boolean

Translate the epoch time value into a human readable date and time string. This flag also can set the format string to apply when translating the date to human readable format. For a list of available pattern letters see the documentation.

- The default format is `yyyy-mm-dd HH:MM:ss.l o` in UTC.
- Requires a `SYS:` prefix to translate time to the local system's timezone. Use the shortcut `SYS:standard` to translate time to `yyyy-mm-dd HH:MM:ss.l o` in system timezone.

#### Default

    false

- Defined in node_modules/pino-pretty/index.d.ts:53

### `Optional` levelFirst

levelFirst?: boolean

If set to true, it will print the name of the log level as the first field in the log line.

#### Default

    false

- Defined in node_modules/pino-pretty/index.d.ts:58

### `Optional` levelKey

levelKey?: string

Define the key that contains the level of the log.

#### Default

    "level"

- Defined in node_modules/pino-pretty/index.d.ts:63

### `Optional` levelLabel

levelLabel?: string

Output the log level using the specified label.

#### Default

    "levelLabel"

- Defined in node_modules/pino-pretty/index.d.ts:68

### `Optional` messageKey

messageKey?: string

The key in the JSON object to use as the highlighted message.

#### Default

    "msg"

    Not required when used with pino >= 8.21.0

- Defined in node_modules/pino-pretty/index.d.ts:75

### `Optional` singleLine

singleLine?: boolean

Print each log message on a single line (errors will still be multi-line).

#### Default

    false

- Defined in node_modules/pino-pretty/index.d.ts:80

### `Optional` timestampKey

timestampKey?: string

The key in the JSON object to use for timestamp display.

#### Default

    "time"

- Defined in node_modules/pino-pretty/index.d.ts:85

### `Optional` minimumLevel

minimumLevel?: Level

The minimum log level to include in the output.

#### Default

    "trace"

- Defined in node_modules/pino-pretty/index.d.ts:90

### `Optional` messageFormat

messageFormat?: string | false | MessageFormatFunc

Format output of message, e.g. {level} - {pid} will output message: INFO - 1123

#### Default

    false

#### Example

    {
      messageFormat: (log, messageKey) => {
        const message = log[messageKey];
        if (log.requestId) return `[${log.requestId}] ${message}`;
        return message;
      }
    }

- Defined in node_modules/pino-pretty/index.d.ts:106

### `Optional` colorize

colorize?: boolean

If set to true, will add color information to the formatted output message.

#### Default

    false

- Defined in node_modules/pino-pretty/index.d.ts:111

### `Optional` colorizeObjects

colorizeObjects?: boolean

If set to false while `colorize` is `true`, will output JSON objects without color.

#### Default

    true

- Defined in node_modules/pino-pretty/index.d.ts:116

### `Optional` crlf

crlf?: boolean

Appends carriage return and line feed, instead of just a line feed, to the formatted log line.

#### Default

    false

- Defined in node_modules/pino-pretty/index.d.ts:121

### `Optional` errorLikeObjectKeys

errorLikeObjectKeys?: string[]

Define the log keys that are associated with error like objects.

#### Default

    ["err", "error"]

    Not required to handle custom errorKey when used with pino >= 8.21.0

- Defined in node_modules/pino-pretty/index.d.ts:128

### `Optional` errorProps

errorProps?: string

When formatting an error object, display this list of properties. The list should be a comma separated list of properties.

#### Default

    ""

- Defined in node_modules/pino-pretty/index.d.ts:134

### `Optional` ignore

ignore?: string

Ignore one or several keys. Will be overridden by the option include if include is presented.

#### Example

    "time,hostname"

- Defined in node_modules/pino-pretty/index.d.ts:140

### `Optional` include

include?: string

Include one or several keys.

#### Example

    "time,level"

- Defined in node_modules/pino-pretty/index.d.ts:145

### `Optional` sync

sync?: boolean

Makes messaging synchronous.

#### Default

    false

- Defined in node_modules/pino-pretty/index.d.ts:150

### `Optional` destination

destination?:
| string
| number
| DestinationStream
| WritableStream

The file, file descriptor, or stream to write to. Defaults to 1 (stdout).

#### Default

    1

- Defined in node_modules/pino-pretty/index.d.ts:155

### `Optional` append

append?: boolean

Opens the file with the 'a' flag.

#### Default

    true

- Defined in node_modules/pino-pretty/index.d.ts:160

### `Optional` mkdir

mkdir?: boolean

Ensure directory for destination file exists.

#### Default

    false

- Defined in node_modules/pino-pretty/index.d.ts:165

### `Optional` customPrettifiers

customPrettifiers?: Record<string, Prettifier<object>> & {
level?: Prettifier<LevelPrettifierExtras>;
}

Provides the ability to add a custom prettify function for specific log properties. `customPrettifiers` is an object, where keys are log properties that will be prettified and value is the prettify function itself. For example, if a log line contains a query property, you can specify a prettifier for it:

#### Default

    {}

#### Example

    {
      customPrettifiers: {
        query: prettifyQuery
      }
    }
    //...
    const prettifyQuery = value => {
     // do some prettify magic
    }

- Defined in node_modules/pino-pretty/index.d.ts:186

### `Optional` customLevels

customLevels?: string | object

Change the level names and values to an user custom preset.

Can be a CSV string in 'level_name:level_value' format or an object.

#### Example

    ( CSV ) customLevels: 'info:10,some_level:40'

#### Example

    ( Object ) customLevels: { info: 10, some_level: 40 }

    Not required when used with pino >= 8.21.0

- Defined in node_modules/pino-pretty/index.d.ts:200

### `Optional` customColors

customColors?: string | object

Change the level colors to an user custom preset.

Can be a CSV string in 'level_name:color_value' format or an object. Also supports 'default' as level_name for fallback color.

#### Example

    ( CSV ) customColors: 'info:white,some_level:red'

#### Example

    ( Object ) customColors: { info: 'white', some_level: 'red' }

- Defined in node_modules/pino-pretty/index.d.ts:210

### `Optional` useOnlyCustomProps

useOnlyCustomProps?: boolean

Only use custom levels and colors (if provided); else fallback to default levels and colors.

#### Default

    true

- Defined in node_modules/pino-pretty/index.d.ts:216