Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2892868
AphlictLog.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
AphlictLog.js
View Options
var
JX
=
require
(
'javelin'
).
JX
;
var
fs
=
require
(
'fs'
);
var
util
=
require
(
'util'
);
JX
.
install
(
'AphlictLog'
,
{
construct
:
function
()
{
this
.
_writeToLogs
=
[];
this
.
_writeToConsoles
=
[];
},
members
:
{
_writeToConsoles
:
null
,
_writeToLogs
:
null
,
addLogfile
:
function
(
path
)
{
var
options
=
{
flags
:
'a'
,
encoding
:
'utf8'
,
mode
:
0664
,
};
var
logfile
=
fs
.
createWriteStream
(
path
,
options
);
this
.
_writeToLogs
.
push
(
logfile
);
return
this
;
},
addConsole
:
function
(
console
)
{
this
.
_writeToConsoles
.
push
(
console
);
return
this
;
},
log
:
function
()
{
var
str
=
util
.
format
.
apply
(
null
,
arguments
);
var
date
=
new
Date
().
toLocaleString
();
str
=
'['
+
date
+
'] '
+
str
;
var
ii
;
for
(
ii
=
0
;
ii
<
this
.
_writeToConsoles
.
length
;
ii
++
)
{
this
.
_writeToConsoles
[
ii
].
log
(
str
);
}
for
(
ii
=
0
;
ii
<
this
.
_writeToLogs
.
length
;
ii
++
)
{
this
.
_writeToLogs
[
ii
].
write
(
str
+
'\n'
);
}
}
}
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 19, 17:28 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1126965
Default Alt Text
AphlictLog.js (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment