diff gs_logger.rb @ 0:1eef88068f9f tip

initial commit of maze game source
author ferencd
date Sun, 15 Sep 2019 11:46:47 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gs_logger.rb	Sun Sep 15 11:46:47 2019 +0200
@@ -0,0 +1,34 @@
+require 'singleton'
+require 'logger'
+
+class GsLogger
+  include Singleton
+
+  def initialize
+    @logger = Logger.new File.new('gameserver.log', 'w')
+  end
+
+  def info(*args)
+    @logger.info(*args)
+  end
+
+  def debug(*args)
+    @logger.debug(*args)
+  end
+
+  def warn(*args)
+    @logger.warn(*args)
+  end
+
+  def error(*args)
+    @logger.error(*args)
+  end
+
+  def fatal(*args)
+    @logger.fatal(*args)
+  end
+
+end
+
+# This will be the one and only logger in the system
+$LOG = GsLogger.instance