new logging
This commit is contained in:
parent
4f13283532
commit
8774a1adf5
@ -71,6 +71,8 @@
|
||||
<div id="log-area" class="foot logging">
|
||||
<div class="log-tabs">
|
||||
<div id="bt_play" class="active logwindow">Playing</div>
|
||||
<div id="bt_dec" class="logwindow">Decoder</div>
|
||||
<div id="bt_enc" class="logwindow">Encoder</div>
|
||||
<div id="bt_sys" class="logwindow">System</div>
|
||||
</div>
|
||||
|
||||
|
@ -647,7 +647,7 @@ footer logging taps
|
||||
|
||||
.log-tabs {
|
||||
overflow: hidden;
|
||||
max-width: 127px;
|
||||
max-width: 263px;
|
||||
color: #111111;
|
||||
}
|
||||
|
||||
|
@ -344,13 +344,35 @@ function get_log(logtype) {
|
||||
$('#bt_play').click(function() {
|
||||
$(this).addClass("active");
|
||||
$('#bt_sys').removeClass("active");
|
||||
$('#bt_enc').removeClass("active");
|
||||
$('#bt_dec').removeClass("active");
|
||||
|
||||
get_log("playing");
|
||||
});
|
||||
|
||||
$('#bt_dec').click(function() {
|
||||
$(this).addClass("active");
|
||||
$('#bt_sys').removeClass("active");
|
||||
$('#bt_enc').removeClass("active");
|
||||
$('#bt_play').removeClass("active");
|
||||
|
||||
get_log("decoder");
|
||||
});
|
||||
|
||||
$('#bt_enc').click(function() {
|
||||
$(this).addClass("active");
|
||||
$('#bt_sys').removeClass("active");
|
||||
$('#bt_dec').removeClass("active");
|
||||
$('#bt_play').removeClass("active");
|
||||
|
||||
get_log("encoder");
|
||||
});
|
||||
|
||||
$('#bt_sys').click(function() {
|
||||
$(this).addClass("active");
|
||||
$('#bt_play').removeClass("active");
|
||||
$('#bt_enc').removeClass("active");
|
||||
$('#bt_dec').removeClass("active");
|
||||
|
||||
get_log("system");
|
||||
});
|
||||
|
@ -2,20 +2,33 @@
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 'On');
|
||||
|
||||
// get config file
|
||||
function get_ini() {
|
||||
return parse_ini_file("/etc/ffplayout/ffplayout.conf", TRUE, INI_SCANNER_RAW);
|
||||
}
|
||||
|
||||
function printer($file) {
|
||||
$ini = get_ini();
|
||||
$log_file = $ini['LOGGING']['log_path'] . $file;
|
||||
$open_log = fopen($log_file, "r") or die("Unable to open file!");
|
||||
echo fread($open_log,filesize($log_file));
|
||||
fclose($open_log);
|
||||
}
|
||||
|
||||
// get playout log
|
||||
if(!empty($_GET['log_from'])) {
|
||||
$log_from = $_GET['log_from'];
|
||||
|
||||
if ($log_from === "playing") {
|
||||
$get_ini = file_get_contents("/etc/ffplayout/ffplayout.conf");
|
||||
$get_path = "/^log_file.*\$/m";
|
||||
preg_match_all($get_path, $get_ini, $matches);
|
||||
$line = implode("\n", $matches[0]);
|
||||
$log_file = explode("= ", $line)[1];
|
||||
printer("/ffplayout.log");
|
||||
}
|
||||
|
||||
$open_log = fopen($log_file, "r") or die("Unable to open file!");
|
||||
echo fread($open_log,filesize($log_file));
|
||||
fclose($open_log);
|
||||
if ($log_from === "decoder") {
|
||||
printer("/decoder.log");
|
||||
}
|
||||
|
||||
if ($log_from === "encoder") {
|
||||
printer("/encoder.log");
|
||||
}
|
||||
|
||||
if ($log_from === "system") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user