aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/logs
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-15 15:26:15 +0200
committerChocobozzz <me@florianbigard.com>2019-04-24 16:25:52 +0200
commit94565d52bb2883e09f16d1363170ac9c0dccb7a1 (patch)
tree3dcd20cd7b5a5cca80bce32b655cdbfaddf7aa59 /shared/extra-utils/logs
parent4ee7a4c9ac9280cda930a281c2d5a9a4c409cc14 (diff)
downloadPeerTube-94565d52bb2883e09f16d1363170ac9c0dccb7a1.tar.gz
PeerTube-94565d52bb2883e09f16d1363170ac9c0dccb7a1.tar.zst
PeerTube-94565d52bb2883e09f16d1363170ac9c0dccb7a1.zip
Shared utils -> extra-utils
Because they need dev dependencies
Diffstat (limited to 'shared/extra-utils/logs')
-rw-r--r--shared/extra-utils/logs/logs.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/shared/extra-utils/logs/logs.ts b/shared/extra-utils/logs/logs.ts
new file mode 100644
index 000000000..cbb1afb93
--- /dev/null
+++ b/shared/extra-utils/logs/logs.ts
@@ -0,0 +1,18 @@
1import { makeGetRequest } from '../requests/requests'
2import { LogLevel } from '../../models/server/log-level.type'
3
4function getLogs (url: string, accessToken: string, startDate: Date, endDate?: Date, level?: LogLevel) {
5 const path = '/api/v1/server/logs'
6
7 return makeGetRequest({
8 url,
9 path,
10 token: accessToken,
11 query: { startDate, endDate, level },
12 statusCodeExpected: 200
13 })
14}
15
16export {
17 getLogs
18}