Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
Debug is a function that logs a debug level message. It takes a message and a variadic parameter of fields.
func Error ¶
Error is a function that logs an error level message. It takes a message and a variadic parameter of fields.
func Fatal ¶
Fatal is a function that logs a fatal level message. It takes a message and a variadic parameter of fields. After logging the message, it calls os.Exit(1) to terminate the program.
func Info ¶
Info is a function that logs an info level message. It takes a message and a variadic parameter of fields.
func Init ¶
func Init(env string)
Init is a function that initializes the logger. It takes the environment name as a parameter. Depending on the environment, it sets up the logger for development or production. For development, it uses the built-in development configuration of zap. For production, it creates a new logger with a file and console syncer, and a JSON encoder. If the environment is not recognized, it logs a fatal error. Finally, it names the logger with the name from the configuration.
Types ¶
This section is empty.