Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.
Nikita edited this page Feb 6, 2019 · 4 revisions

ALog - Fast and asynchronous logger.

Install

Configure

Install

go get -u github.com/mylockerteam/aLog

Configure

package main

import (
	"alog/Alog"
	"io"
	"sync"
)

var logger struct{
	instance *Alog.Log
	once     sync.Once
}

func GetLogger() *Alog.Log {
    logger.once.Do(func() {
        logger.instance = Alog.Create(&Alog.Config{
            Loggers: Alog.LoggerMap{
                Alog.LoggerInfo: {
                    Channel: make(chan string, 100),
                    Strategies: []io.Writer{
                        Alog.GetFileStrategy("<Full absolute file path>"),
                        Alog.GetDefaultStrategy(),
                    },
                },
            },
        })
    })
    return logger.instance
}
Clone this wiki locally