아래 남겨주신 콘솔로그(개발자 도구) 정보
아래 남겨주신 콘솔로그(개발자 도구)
본문
https://github.com/adamschwartz/log
개인적으로 개작해서 php로 사용중입니다.
// 콘솔모드에 데이터를 출력한다. (https://github.com/adamschwartz/log)
/*
console('BOX', 'box');
console('CODE', 'code');
console('RED', 'red');
console('BLUE', 'blue');
console('text');
console('[c="color:#d200ff; font-weight:bold"]user style[c]');
console('user style2', 'color:#d200ff; font-weight:bold; font-size:20px;');
console('user style333', 'color:#ff0000; font-weight:bold; font-size:20px;');
*/
function console($Data, $style='') {
global $system;
static $tb_console2 = true;
$uniqid = uniqid();
if($tb_console2) {
echo "<script>\r\n//<![CDATA[\r\nif(!console){var console={log:function(){}}}\r\n</script>".PHP_EOL;
echo "<script src='".$system['__url']."/js/log.min.js'></script>".PHP_EOL;
echo "<script>
var ConsoleLogBox = 'font-family: \'Helvetica Neue\', Helvetica, Arial, sans-serif; color: #fff; font-size: 20px; padding: 15px 20px; background: #444; border-radius: 4px; line-height: 100px; text-shadow: 0 1px #000';
var ConsoleLogCode = 'background: rgb(255, 255, 219); padding: 1px 5px; border: 1px solid rgba(0, 0, 0, 0.1)';
var ConsoleLogFontRed = 'color:#ff0000';
var ConsoleLogFontBlue = 'color:#2400ff';
</script>".PHP_EOL;
}
if($style == 'box') { $StyleCode = 'ConsoleLogBox'; }
else if($style == 'code') { $StyleCode = 'ConsoleLogCode'; }
else if($style == 'red') { $StyleCode = 'ConsoleLogFontRed'; }
else if($style == 'blue') { $StyleCode = 'ConsoleLogFontBlue'; }
else if($style) { $StyleCode = 'ConsoleLogUserStyle_'.$uniqid; }
echo "<script>";
if($StyleCode == 'ConsoleLogUserStyle_'.$uniqid) echo 'var ConsoleLogUserStyle_'.$uniqid.' = "'.$style.'"; '.PHP_EOL;
if($style) {
$LogHeader = "%c";
$LogTail = ", $StyleCode";
}
$output = explode("\r\n", $Data);
if(is_array($Data)) {
$lines = json_encode($Data);
echo "console.table({$lines});".PHP_EOL;
}
else if(trim($output)) {
foreach($output as $line) {
$line = addslashes($line);
echo "log('{$LogHeader}{$line}'{$LogTail}); ".PHP_EOL;
}
}
echo "</script>".PHP_EOL;
$tb_console2 = false;
}
2
댓글 17개

간혹가다 데이터 조작 금지 법적 사항을 뿌려주기도 하구요 ㅎㅎ

저는 제 아이디에만 보이도록..ㅋㅋ







처음 알았어요 ㅎㅎㅎㅎ





