Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 9.9% on proxy.golang.org

proxy.golang.org : github.com/takecontrolsoft/go_multi_log

Multiple Logs package "go_multi_log" is Go package that provides logging in multiple loggers (console, file and other) with log levels. https://github.com/takecontrolsoft/go_multi_log - Log messages: - Log error object: - Log any object - Log formatted message Using formatting functions "DebugF", "TraceF", "InfoF", "WarningF", "ErrorF", "FatalF" - Change log level To change the default log level use "SetLevel(levels.All)". This will cause all the messages for levels greater or equal to the new level also to be logged. The level is changed for the whole application. Avoid changing the level inside Goroutine (go lightweight thread). - Stop and Start logging No messages will be logged after calling "Stop" function. Logging could be resumed with calling "Start" function. In this example only "Message 2" will be logged. Use the following functions to register, unregister or get loggers by key. One default logger always exists and can not be unregistered, but can be stopped. - Default console log: A simple "ConsoleLogger" is set by default and it can be obtained from "logger.DefaultLogger()". This logger can not be unregistered, but it can be stopped and resumed. - Custom console log: Custom console log can be registered for example to log only Debug messages using new formatting string. See the example: "FileLogger" can be added as an additional logger to prints the messages to files. - Use "NewFileLoggerDefault" to initialize the file logger with the default settings. Default [LogLevel] is levels.Info. Default [FileOptions] are used: Directory: current executable directory. FilePrefix: "mLog". FileExtension: ".log". Example: - Use "NewFileLogger" to initialize the file logger with the customized settings. Custom loggers implementations can be easily added by implementing the interface [loggers.LoggerInterface] or deriving the base class [loggers.LoggerType], which already implements most of the function. https://github.com/takecontrolsoft/go_multi_log?tab=readme-ov-file#custom-logger The package is created and maintained by "Take Control - software & infrastructure". Web site: https://takecontrolsoft.eu

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/takecontrolsoft/go_multi_log
Keywords: log
License: Apache-2.0
Latest release: 3 months ago
First release: 5 months ago
Namespace: github.com/takecontrolsoft
Stars: 1 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 28 days ago

    Loading...
    Readme
    Loading...