-
Notifications
You must be signed in to change notification settings - Fork 127
/
Copy pathgoogleLogs.js
38 lines (30 loc) · 928 Bytes
/
googleLogs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
'use strict';
const BbPromise = require('bluebird');
const validate = require('../shared/validate');
const setDefaults = require('../shared/utils');
const retrieveLogs = require('./lib/retrieveLogs');
class GoogleLogs {
constructor(serverless, options) {
this.serverless = serverless;
this.options = options;
this.provider = this.serverless.getProvider('google');
this.commands = {
logs: {
lifecycleEvents: ['logs'],
options: {
count: {
usage: 'Amount of requested logs',
shortcut: 'c',
type: 'string',
},
},
},
};
Object.assign(this, validate, setDefaults, retrieveLogs);
this.hooks = {
'before:logs:logs': () => BbPromise.bind(this).then(this.validate).then(this.setDefaults),
'logs:logs': () => BbPromise.bind(this).then(this.retrieveLogs),
};
}
}
module.exports = GoogleLogs;