Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cad38ae

Browse filesBrowse files
committed
bug #3721 tweaks to the Console logger (xabbuh)
This PR was merged into the master branch. Discussion ---------- tweaks to the Console logger | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.5+ | Fixed tickets | This fixes some issue to the new Console logger introduced in #3696. Commits ------- 610eb6b code fixes as mentioned by @dirkluijk 83adc87 fix class roles 3bbccf7 fix PSR-3 link as mentioned by @max-voloshin 9b0911b fix grammer mistake dd16589 add logger chapter to the component's map
2 parents 974cb18 + 610eb6b commit cad38ae
Copy full SHA for cad38ae

File tree

Expand file treeCollapse file tree

2 files changed

+10
-9
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+10
-9
lines changed
Open diff view settings
Collapse file

‎components/console/logger.rst‎

Copy file name to clipboardExpand all lines: components/console/logger.rst
+9-9Lines changed: 9 additions & 9 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ Using the Logger
99
introduced in Symfony 2.5.
1010

1111
The Console component comes with a standalone logger complying with the
12-
`PSR-3_` standard.
13-
Depending of the verbosity setting, log messages will be sent to the
14-
:class:`Symfony\\Component\\Console\\Output\\OutputInterface` instance
15-
passed as a parameter to the constructor.
12+
`PSR-3`_ standard. Depending on the verbosity setting, log messages will
13+
be sent to the :class:`Symfony\\Component\\Console\\Output\\OutputInterface`
14+
instance passed as a parameter to the constructor.
1615

1716
The logger does not have any external dependency except ``php-fig/log``.
1817
This is useful for console applications and commands needing a lightweight
@@ -63,20 +62,21 @@ You can rely on the logger to use this dependency inside a command::
6362
{
6463
$logger = new ConsoleLogger($output);
6564

66-
$myDependency = MyDependency($logger);
65+
$myDependency = new MyDependency($logger);
6766
$myDependency->doStuff();
6867
}
6968
}
7069

7170
The dependency will use the instance of
72-
``Symfony\\Component\\Console\\Logger\\ConsoleLogger`` as logger.
71+
:class:`Symfony\\Component\\Console\\Logger\\ConsoleLogger` as logger.
7372
Log messages emitted will be displayed on the console output.
7473

7574
Verbosity
7675
---------
7776

7877
Depending on the verbosity level that the command is run, messages may or
79-
may not be sent to the ``Symfony\\Component\\Console\\Output\\OutputInterface`` instance.
78+
may not be sent to the :class:`Symfony\\Component\\Console\\Output\\OutputInterface`
79+
instance.
8080

8181
By default, the console logger behaves like the
8282
:doc:`Monolog's Console Handler </cookbook/logging/monolog_console>`.
@@ -99,10 +99,10 @@ level. This behavior is configurable through the third parameter of the
9999
constructor::
100100

101101
// ...
102-
private $formatLevelMap = array(
102+
$formatLevelMap = array(
103103
LogLevel::CRITICAL => self::INFO,
104104
LogLevel::DEBUG => self::ERROR,
105105
);
106106
$logger = new ConsoleLogger($output, array(), $formatLevelMap);
107107

108-
.. _PSR-3: http://www.php-fig.org/psr/psr-3/
108+
.. _PSR-3: http://www.php-fig.org/psr/psr-3/
Collapse file

‎components/map.rst.inc‎

Copy file name to clipboardExpand all lines: components/map.rst.inc
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* :doc:`/components/console/single_command_tool`
2424
* :doc:`/components/console/changing_default_command`
2525
* :doc:`/components/console/events`
26+
* :doc:`/components/console/logger`
2627
* :doc:`/components/console/helpers/index`
2728

2829
* **CssSelector**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.