Ubiquity
2.5.2
php rapid development framework
Loading...
Searching...
No Matches
LogMessage.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Ubiquity\log
;
4
5
class
LogMessage
{
6
7
private
$message
;
8
private
$context
;
9
private
$part
;
10
private
$level
;
11
private
$extra
;
12
private
$datetime
;
13
private
$count
=1;
14
15
public
function
__construct
(
$message
=
""
,
$context
=
""
,
$part
=
""
,
$level
=0,
$datetime
=
null
,
$extra
=
null
){
16
$this->message=
$message
;
17
$this->context=
$context
;
18
$this->part=
$part
;
19
$this->level=
$level
;
20
$this->datetime=
$datetime
;
21
$this->extra=
$extra
;
22
}
26
public
function
getMessage
() {
27
return
$this->message
;
28
}
29
33
public
function
getContext
() {
34
return
$this->context
;
35
}
36
40
public
function
getPart
() {
41
return
$this->part
;
42
}
43
47
public
function
getLevel
() {
48
return
$this->level
;
49
}
50
54
public
function
getExtra
() {
55
return
$this->extra
;
56
}
57
61
public
function
getDatetime
() {
62
return
$this->datetime
;
63
}
64
68
public
function
setMessage
(
$message
) {
69
$this->message =
$message
;
70
}
71
75
public
function
setContext
(
$context
) {
76
$this->context =
$context
;
77
}
78
82
public
function
setPart
(
$part
) {
83
$this->part =
$part
;
84
}
85
89
public
function
setLevel
(
$level
) {
90
$this->level =
$level
;
91
}
92
96
public
function
setExtra
(
$extra
) {
97
$this->extra =
$extra
;
98
}
99
103
public
function
setDatetime
(
$datetime
) {
104
$this->datetime =
$datetime
;
105
}
106
107
public
function
incCount
(){
108
$this->count++;
109
}
113
public
function
getCount
() {
114
return
$this->count
;
115
}
116
117
public
function
equals
(
LogMessage
$message
){
118
return
$this->message===
$message
->getMessage() && $this->context===
$message
->getContext() && $this->part===
$message
->getPart();
119
}
120
121
public
static
function
addMessage
(&$messages,
LogMessage
$newMessage){
122
if
(!empty($messages)){
123
$lastM=end($messages);
124
if
($newMessage->
equals
($lastM)){
125
return
$lastM->incCount();
126
}
127
}
128
$messages[]=$newMessage;
129
}
130
131
}
132
Ubiquity\log\LogMessage
Definition
LogMessage.php:5
Ubiquity\log\LogMessage\getMessage
getMessage()
Definition
LogMessage.php:26
Ubiquity\log\LogMessage\setExtra
setExtra($extra)
Definition
LogMessage.php:96
Ubiquity\log\LogMessage\setLevel
setLevel($level)
Definition
LogMessage.php:89
Ubiquity\log\LogMessage\setDatetime
setDatetime($datetime)
Definition
LogMessage.php:103
Ubiquity\log\LogMessage\addMessage
static addMessage(&$messages, LogMessage $newMessage)
Definition
LogMessage.php:121
Ubiquity\log\LogMessage\getLevel
getLevel()
Definition
LogMessage.php:47
Ubiquity\log\LogMessage\getCount
getCount()
Definition
LogMessage.php:113
Ubiquity\log\LogMessage\$datetime
$datetime
Definition
LogMessage.php:12
Ubiquity\log\LogMessage\setContext
setContext($context)
Definition
LogMessage.php:75
Ubiquity\log\LogMessage\getContext
getContext()
Definition
LogMessage.php:33
Ubiquity\log\LogMessage\setMessage
setMessage($message)
Definition
LogMessage.php:68
Ubiquity\log\LogMessage\$extra
$extra
Definition
LogMessage.php:11
Ubiquity\log\LogMessage\__construct
__construct($message="", $context="", $part="", $level=0, $datetime=null, $extra=null)
Definition
LogMessage.php:15
Ubiquity\log\LogMessage\getExtra
getExtra()
Definition
LogMessage.php:54
Ubiquity\log\LogMessage\setPart
setPart($part)
Definition
LogMessage.php:82
Ubiquity\log\LogMessage\$part
$part
Definition
LogMessage.php:9
Ubiquity\log\LogMessage\getPart
getPart()
Definition
LogMessage.php:40
Ubiquity\log\LogMessage\getDatetime
getDatetime()
Definition
LogMessage.php:61
Ubiquity\log\LogMessage\equals
equals(LogMessage $message)
Definition
LogMessage.php:117
Ubiquity\log\LogMessage\$level
$level
Definition
LogMessage.php:10
Ubiquity\log\LogMessage\$message
$message
Definition
LogMessage.php:7
Ubiquity\log\LogMessage\incCount
incCount()
Definition
LogMessage.php:107
Ubiquity\log\LogMessage\$context
$context
Definition
LogMessage.php:8
Ubiquity\log\LogMessage\$count
$count
Definition
LogMessage.php:13
Ubiquity\log
Definition
HtmlLogFormatter.php:3
C:
Users
myadd
Documents
GitHub
ubiquity-doc-api
vendor
phpmv
ubiquity
src
Ubiquity
log
LogMessage.php
Generated on Sun Dec 10 2023 15:04:22 for
Ubiquity
by
doxygen
1.9.8