Merge "registration: Sync extension.schema.json with reality"
[lhc/web/wiklou.git] / includes / debug / logger / Logger.php
1 <?php
2 /**
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
17 *
18 * @file
19 */
20
21
22 /**
23 * Backwards compatibility stub for usage from before the introduction of
24 * MWLoggerFactory.
25 *
26 * @deprecated since 1.25 Use MWLoggerFactory
27 * @todo This class should be removed before the 1.25 final release.
28 */
29 class MWLogger {
30
31 /**
32 * Register a service provider to create new \Psr\Log\LoggerInterface
33 * instances.
34 *
35 * @param MWLoggerSpi $provider Provider to register
36 * @deprecated since 1.25 Use MWLoggerFactory::registerProvider()
37 */
38 public static function registerProvider( MWLoggerSpi $provider ) {
39 MWLoggerFactory::registerProvider( $provider );
40 }
41
42
43 /**
44 * Get the registered service provider.
45 *
46 * If called before any service provider has been registered, it will
47 * attempt to use the $wgMWLoggerDefaultSpi global to bootstrap
48 * MWLoggerSpi registration. $wgMWLoggerDefaultSpi is expected to be an
49 * array usable by ObjectFactory::getObjectFromSpec() to create a class.
50 *
51 * @return MWLoggerSpi
52 * @see registerProvider()
53 * @see ObjectFactory::getObjectFromSpec()
54 * @deprecated since 1.25 Use MWLoggerFactory::getProvider()
55 */
56 public static function getProvider() {
57 return MWLoggerFactory::getProvider();
58 }
59
60
61 /**
62 * Get a named logger instance from the currently configured logger factory.
63 *
64 * @param string $channel Logger channel (name)
65 * @return \Psr\Log\LoggerInterface
66 * @deprecated since 1.25 Use MWLoggerFactory::getInstance()
67 */
68 public static function getInstance( $channel ) {
69 return MWLoggerFactory::getInstance( $channel );
70 }
71
72 }