blob: d468df818ed3eeec1041929bd5e35a7ca1427c16 [file] [log] [blame]
Nick Kralevichdabf4d52011-12-15 11:43:38 -08001/*
2 * Copyright (C) 2012-2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Tom Cherry7955fd42020-05-06 12:04:09 -070017#pragma once
Nick Kralevichdabf4d52011-12-15 11:43:38 -080018
Tom Cherry7955fd42020-05-06 12:04:09 -070019#include "LogBuffer.h"
Nick Kralevichdabf4d52011-12-15 11:43:38 -080020#include "LogReader.h"
21
Tom Cherry7955fd42020-05-06 12:04:09 -070022class LogListener {
23 public:
Tom Cherry5ecfbf02020-05-11 16:29:29 -070024 LogListener(LogBuffer* buf);
Tom Cherry7955fd42020-05-06 12:04:09 -070025 bool StartListener();
Nick Kralevichdabf4d52011-12-15 11:43:38 -080026
Tom Cherry7955fd42020-05-06 12:04:09 -070027 private:
28 void ThreadFunction();
29 void HandleData();
30 static int GetLogSocket();
Nick Kralevichdabf4d52011-12-15 11:43:38 -080031
Tom Cherry7955fd42020-05-06 12:04:09 -070032 int socket_;
33 LogBuffer* logbuf_;
Nick Kralevichdabf4d52011-12-15 11:43:38 -080034};