# core/reporters/ontology.reporter.ts

> 14 lines of code and 2 definitions.

Tree: GovLab Context
Language: typescript
Layer: operations
Canonical: https://banes-lab.com/anatomy/context#file-context-core-reporters-ontology-reporter-ts
Source text: https://banes-lab.com/source/context/core/reporters/ontology.reporter.ts.txt

Listed in [core/reporters](https://banes-lab.com/api/source/context/core/reporters.md).

## Definitions

- `debugLogger` (lexical_declaration, line 7, exported)
- `NOOP_LOGGER` (lexical_declaration, line 5, exported)

## Contained in

- [core/reporters](https://banes-lab.com/anatomy/context/folder-context-core-reporters.md)

## Uses

- [configuration/strings/ontology.strings.ts](https://banes-lab.com/source/context/configuration/strings/ontology.strings.ts.md)

## Linked from

- [configuration/strings](https://banes-lab.com/anatomy/context/folder-context-configuration-strings.md)

## Source

```typescript
import type { Logger } from "#types/ontology.types";
import { debugLine } from "#configuration/strings/ontology.strings";
import process from "node:process";

export const NOOP_LOGGER: Logger = { warn: () => {} };

export const debugLogger = function debugLogger(enabled: boolean): Logger {
    if (!enabled) {
        return NOOP_LOGGER;
    }
    return {
        warn: (message, detail) => {
            process.stderr.write(`${debugLine(message)} ${JSON.stringify(detail ?? null)}\n`);
        },
    };
};
```
