## Apache Zeta Components Manual :: File Source for log_entry.php

## Source for file log_entry.php

Documentation is available at log_entry.php

1. <?php
2. /**
3. *
4. * Licensed to the Apache Software Foundation (ASF) under one
5. * or more contributor license agreements. See the NOTICE file
6. * distributed with this work for additional information
7. * regarding copyright ownership. The ASF licenses this file
8. * to you under the Apache License, Version 2.0 (the
9. * "License"); you may not use this file except in compliance
10. * with the License. You may obtain a copy of the License at
11. *
12. * http://www.apache.org/licenses/LICENSE-2.0
13. *
14. * Unless required by applicable law or agreed to in writing,
15. * software distributed under the License is distributed on an
16. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17. * KIND, either express or implied. See the License for the
18. * specific language governing permissions and limitations
19. * under the License.
20. *
21. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
22. * @version //autogentag//
23. * @filesource
24. * @package EventLog
25. */
27. /**
28. * File containing the ezcLogEntry class.
29. *
30. * The ezcLogEntry class provides a structure to represent a log entry with all
31. * data passed to ezcLog::log().
32. *
33. * This class is used for entries hold by the ezcLogStackWriter.
34. *
35. * @package EventLog
36. * @version //autogentag//
37. */
38. class ezcLogEntry extends ezcBaseStruct
39. {
40. /**
41. * The textual log message.
42. *
43. * @var string
44. */
45. public $message ;
47. /**
48. * Severity of the log message.
49. *
50. * @var int
51. */
52. public $severity ;
54. /**
55. * The source of the log message.
56. *
57. * @var string
58. */
59. public $source ;
61. /**
62. * The category of the log message.
63. *
64. * @var string
65. */
66. public $category ;
68. /**
69. * Optional informations
70. *
71. * @var array
72. */
73. public $optional ;
75. /**
76. * The timestamp of the moment when this object was created
77. *
78. * @var int
79. */
80. public $timestamp ;
82. /**
83. * Constructs a new ezcLogEntry.
84. *
85. * @param string $message
86. * @param int $severity
87. * @param string $source
88. * @param string $category
89. * @param array $optional
90. * @param int $timestamp
91. */
92. public function __construct ( $message = '', $severity = 0,
93. $source = '', $category = '', $optional = array(), $timestamp = null )
94. {
95. $this-> message = $message;
96. $this-> severity = $severity;
97. $this-> source = $source;
98. $this-> category = $category;
99. $this-> optional = $optional;
100. $this-> timestamp = $timestamp === null ? time () : $timestamp;
101. }
103. /**
104. * Returns a new instance of this class with the data specified by $array.
105. *
106. * $array contains all the data members of this class in the form:
107. * array('member_name'=>value).
108. *
109. * __set_state makes this class exportable with var_export.
110. * var_export() generates code, that calls this method when it
111. * is parsed with PHP.
112. *
113. * @param array(string=>mixed) $array
114. * @return ezcLogEntry
115. */
116. static public function __set_state ( array $array )
117. {
118. return new ezcLogEntry( $array['message'], $array['severity'],
119. $array['source'], $array['category'], $array['optional'],
120. $array['timestamp'] );
121. }
122. }
123. ?>

Documentation generated by phpDocumentor 1.4.3