@@ -32,7 +32,7 @@ func NewBaseLogger(config *Config) BaseLogger {
3232 if config == nil {
3333 config = & Config {
3434 BaseLoggerType : Logrus ,
35- Level : DebugLevel ,
35+ Level : TraceLevel ,
3636 FullTimestamp : false ,
3737 TimestampFormat : "2006-01-02 15:04:05" ,
3838 DisableTimestamp : true ,
@@ -48,11 +48,11 @@ func NewBaseLogger(config *Config) BaseLogger {
4848 TimestampFormat : config .TimestampFormat ,
4949 DisableTimestamp : config .DisableTimestamp ,
5050 })
51+
52+ return & baseLogrus {logger : base }
5153 default :
5254 panic ("Unsupported logger type, you are a teapot!!!" )
5355 }
54-
55- return & baseLogrus {logger : logrus .New ()}
5656}
5757
5858// NewLogger creates a new Logger instance from the base logrus logger.
@@ -200,6 +200,33 @@ func (l *logrusAdapter) Fatalf(format string, args ...any) {
200200 l .entry .Fatalf (format , args ... )
201201}
202202
203+ // Panic logs a message at the Panic level and may terminate the application.
204+ //
205+ // Parameters:
206+ //
207+ // - msg: the panic message.
208+ //
209+ // Example usage:
210+ //
211+ // logger.Panic("Unexpected error occurred")
212+ func (l * logrusAdapter ) Panic (msg string ) {
213+ l .entry .Panic (msg )
214+ }
215+
216+ // Panicf logs a formatted panic message at the Panic level and may terminate the application.
217+ //
218+ // Parameters:
219+ //
220+ // - format: the message format.
221+ // - args: the arguments for the format.
222+ //
223+ // Example usage:
224+ //
225+ // logger.Panicf("Critical failure: %s", err)
226+ func (l * logrusAdapter ) Panicf (format string , args ... any ) {
227+ l .entry .Panicf (format , args ... )
228+ }
229+
203230// Trace logs a message at the Trace level, providing fine-grained debugging information.
204231//
205232// Parameters:
0 commit comments