On Thu, Jan 21, 2021 at 10:23:42AM +0800, Luan Shengde wrote:
+# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. +# frozen_string_literal: true
+require 'logger'
+# define a logger format +class Mylog < Logger
- def initialize(filename)
- @name = filename
what does this @name for, it seems no anywhere else use it.
ok, i will del it
Thanks, Shenwei
Thanks, Luan Shengde
- if FileTest.exist?(filename)
File.delete(filename)
- end
- super(filename)
- self.datetime_format = '%Y-%m-%d %H:%M:%s'
- self.formatter = proc do |severity, datetime, _, msg|
"#{datetime}-#{severity}: #{msg}\n"
- end
- end
+end
2.23.0