Completed
Push — master ( 347a51...ad246f )
by Maxence
02:23
created

MiscService::get()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 11
rs 9.9
cc 3
nc 3
nop 3
1
<?php
2
declare(strict_types=1);
3
4
5
/**
6
 * FullTextSearch - Full text search framework for Nextcloud
7
 *
8
 * This file is licensed under the Affero General Public License version 3 or
9
 * later. See the COPYING file.
10
 *
11
 * @author Maxence Lange <[email protected]>
12
 * @copyright 2018
13
 * @license GNU AGPL version 3 or any later version
14
 *
15
 * This program is free software: you can redistribute it and/or modify
16
 * it under the terms of the GNU Affero General Public License as
17
 * published by the Free Software Foundation, either version 3 of the
18
 * License, or (at your option) any later version.
19
 *
20
 * This program is distributed in the hope that it will be useful,
21
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
 * GNU Affero General Public License for more details.
24
 *
25
 * You should have received a copy of the GNU Affero General Public License
26
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
27
 *
28
 */
29
30
31
namespace OCA\FullTextSearch\Service;
32
33
34
use OCA\FullTextSearch\AppInfo\Application;
35
use OCP\ILogger;
36
37
38
/**
39
 * Class MiscService
40
 *
41
 * @package OCA\FullTextSearch\Service
42
 */
43
class MiscService {
44
45
	/** @var ILogger */
46
	private $logger;
47
48
49
	/**
50
	 * MiscService constructor.
51
	 *
52
	 * @param ILogger $logger
53
	 */
54
	public function __construct(ILogger $logger) {
55
		$this->logger = $logger;
56
	}
57
58
59
	/**
60
	 * @param string $message
61
	 * @param int $level
62
	 */
63
	public function log(string $message, int $level = 2) {
64
		$data = array(
65
			'app'   => Application::APP_NAME,
66
			'level' => $level
67
		);
68
69
		$this->logger->log($level, $message, $data);
70
	}
71
72
}
73
74