diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-10 15:26:33 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-10 16:38:32 +0200 |
commit | fd8710b897a67518d3a61c319e54b6a65ba443ef (patch) | |
tree | d9953b7e0bb4e5a119c872ab21021f4c1ab33bea /server/helpers/custom-validators/logs.ts | |
parent | 31b6ddf86652502e0c96d77fa10861ce4af11aa4 (diff) | |
download | PeerTube-fd8710b897a67518d3a61c319e54b6a65ba443ef.tar.gz PeerTube-fd8710b897a67518d3a61c319e54b6a65ba443ef.tar.zst PeerTube-fd8710b897a67518d3a61c319e54b6a65ba443ef.zip |
Add logs endpoint
Diffstat (limited to 'server/helpers/custom-validators/logs.ts')
-rw-r--r-- | server/helpers/custom-validators/logs.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/server/helpers/custom-validators/logs.ts b/server/helpers/custom-validators/logs.ts new file mode 100644 index 000000000..30d0ce262 --- /dev/null +++ b/server/helpers/custom-validators/logs.ts | |||
@@ -0,0 +1,14 @@ | |||
1 | import { exists } from './misc' | ||
2 | import { LogLevel } from '../../../shared/models/server/log-level.type' | ||
3 | |||
4 | const logLevels: LogLevel[] = [ 'debug', 'info', 'warn', 'error' ] | ||
5 | |||
6 | function isValidLogLevel (value: any) { | ||
7 | return exists(value) && logLevels.indexOf(value) !== -1 | ||
8 | } | ||
9 | |||
10 | // --------------------------------------------------------------------------- | ||
11 | |||
12 | export { | ||
13 | isValidLogLevel | ||
14 | } | ||