()
| 71 | } |
| 72 | |
| 73 | async getLogStreams() { |
| 74 | const params = { |
| 75 | logGroupName: this.options.logGroupName, |
| 76 | descending: true, |
| 77 | limit: 50, |
| 78 | orderBy: 'LastEventTime', |
| 79 | } |
| 80 | |
| 81 | const reply = await this.provider.request( |
| 82 | 'CloudWatchLogs', |
| 83 | 'describeLogStreams', |
| 84 | params, |
| 85 | ) |
| 86 | if (!reply || reply.logStreams.length === 0) { |
| 87 | throw new ServerlessError( |
| 88 | 'No existing streams for the function', |
| 89 | 'NO_EXISTING_LOG_STREAMS', |
| 90 | { stack: false }, |
| 91 | ) |
| 92 | } |
| 93 | |
| 94 | return reply.logStreams.map((logStream) => logStream.logStreamName) |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * Show logs |
no test coverage detected