Source

Kephra / lib / Kephra / Log.pm

Full commit
use strict;
use warnings;
use Kephra::API;

package Kephra::Log;

our $level;
our @output;

sub init {}

sub warning { 
	my $msg = timestamp().' '.(caller)[0].'::'. $_[0];
	warn $msg;
	Kephra::API::output('warn', $msg);
}

sub error { die timestamp(), ' ', (caller)[0], '::', $_[0] }

sub timestamp { sprintf("[%02u:%02u:%02u]", (localtime)[2,1,0]) }


1;