logger

package
v0.0.0-...-9139af7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// BaseLogger is the base logger for the server
	BaseLogger = gologger.NewDefaultLogger()

	// ModeLogger is the extended logger for the server with mode support
	ModeLogger, _ = gologgermode.NewDefaultLogger(BaseLogger)

	// Environment is the logger for the environment
	Environment, _ = goloaderenv.NewLogger(
		"ENV",
		ModeLogger,
	)

	// Postgres is the logger for the Postgres client
	Postgres, _ = godatabases.NewLogger(
		"POSTGRES",
		ModeLogger,
	)

	// Router is the logger for the router
	Router, _ = gonethttproute.NewLogger(
		"ROUTER",
		ModeLogger,
	)

	// Api is the logger for the API endpoints
	Api, _ = NewLogger("API", ModeLogger)

	// CacheTokenValidator is the logger for the cache token validator
	CacheTokenValidator, _ = gojwtcache.NewLogger(
		"CACHE TOKEN VALIDATOR",
		ModeLogger,
	)

	// MapperGenerator is the logger for the mapper generator
	MapperGenerator, _ = govalidatormapper.NewLogger(
		"MAPPER GENERATOR",
		ModeLogger,
	)

	// MapperValidator is the logger for the mapper validator
	MapperValidator, _ = govalidatormappervalidator.NewLogger(
		"MAPPER VALIDATOR",
		ModeLogger,
	)

	// MapperParser is the logger for the mapper parser
	MapperParser, _ = govalidatormapperparserjson.NewLogger(
		"MAPPER PARSER",
		ModeLogger,
	)
)

Functions

This section is empty.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger is the logger for the API server

func NewLogger

func NewLogger(header string, modeLogger gologgermode.Logger) (*Logger, error)

NewLogger is the logger for the API server

func (*Logger) AddUserNoteTags

func (l *Logger) AddUserNoteTags(id, noteID int64)

AddUserNoteTags logs the add user note tags event

func (*Logger) ChangeEmail

func (l *Logger) ChangeEmail(id int64, newEmail string)

ChangeEmail logs the change email event

func (*Logger) ChangePassword

func (l *Logger) ChangePassword(id int64)

ChangePassword logs the change password event

func (*Logger) ChangeUsername

func (l *Logger) ChangeUsername(id int64, newUsername string)

ChangeUsername logs the change username event

func (*Logger) CreateUserNote

func (l *Logger) CreateUserNote(id, noteID int64)

CreateUserNote logs the user note creation event

func (*Logger) CreateUserNoteVersion

func (l *Logger) CreateUserNoteVersion(id, noteID, noteVersionID int64)

CreateUserNoteVersion logs the user note version creation event

func (*Logger) CreateUserTag

func (l *Logger) CreateUserTag(id, tagID int64)

CreateUserTag logs the user tag creation event

func (*Logger) DeleteUser

func (l *Logger) DeleteUser(id int64)

DeleteUser logs the delete user event

func (*Logger) DeleteUserNote

func (l *Logger) DeleteUserNote(id, noteID int64)

DeleteUserNote logs the delete user note event

func (*Logger) DeleteUserNoteVersion

func (l *Logger) DeleteUserNoteVersion(id, noteVersionID int64)

DeleteUserNoteVersion logs the delete user note version event

func (*Logger) DeleteUserTag

func (l *Logger) DeleteUserTag(id, tagID int64)

DeleteUserTag logs the delete user tag event

func (*Logger) DisableUser2FA

func (l *Logger) DisableUser2FA(id int64)

DisableUser2FA logs the disable user 2FA event

func (*Logger) EnableUser2FA

func (l *Logger) EnableUser2FA(id int64)

EnableUser2FA logs the enable user 2FA event

func (*Logger) FailedToSend2FAEmailCode

func (l *Logger) FailedToSend2FAEmailCode(email string, err error)

FailedToSend2FAEmailCode logs the failed to send 2FA email code event

func (*Logger) FailedToSendResetPasswordEmail

func (l *Logger) FailedToSendResetPasswordEmail(email string, err error)

FailedToSendResetPasswordEmail logs the failed to send reset password email event

func (*Logger) FailedToSendVerificationEmail

func (l *Logger) FailedToSendVerificationEmail(email string, err error)

FailedToSendVerificationEmail logs the failed to send verification email event

func (*Logger) FailedToSendWelcomeEmail

func (l *Logger) FailedToSendWelcomeEmail(email string, err error)

FailedToSendWelcomeEmail logs the failed to send welcome email event

func (*Logger) ForgotPassword

func (l *Logger) ForgotPassword(id int64)

ForgotPassword logs the forgot password event

func (*Logger) Generate2FATOTPUrl

func (l *Logger) Generate2FATOTPUrl(id int64)

Generate2FATOTPUrl logs the generate 2FA TOTP URL event

func (*Logger) GetMyProfile

func (l *Logger) GetMyProfile(id int64)

GetMyProfile logs the get my profile event

func (*Logger) GetRefreshToken

func (l *Logger) GetRefreshToken(id, refreshTokenID int64)

GetRefreshToken logs the get refresh token event

func (*Logger) GetUserNoteByID

func (l *Logger) GetUserNoteByID(id, noteID int64)

GetUserNoteByID logs the get user note by ID event

func (*Logger) GetUserNoteVersionByID

func (l *Logger) GetUserNoteVersionByID(id, noteVersionID int64)

GetUserNoteVersionByID logs the get user note version by ID event

func (*Logger) GetUserTagByID

func (l *Logger) GetUserTagByID(id, tagID int64)

GetUserTagByID logs the get user tag by ID event

func (*Logger) ListRefreshTokens

func (l *Logger) ListRefreshTokens(id int64)

ListRefreshTokens logs the list refresh tokens event

func (*Logger) ListUserNoteTags

func (l *Logger) ListUserNoteTags(id, noteID int64)

ListUserNoteTags logs the list user note tags event

func (*Logger) ListUserNoteVersions

func (l *Logger) ListUserNoteVersions(id, noteID int64)

ListUserNoteVersions logs the list user note versions event

func (*Logger) ListUserNotes

func (l *Logger) ListUserNotes(id int64)

ListUserNotes logs the list user notes event

func (*Logger) ListUserTags

func (l *Logger) ListUserTags(id int64)

ListUserTags logs the list user tags event

func (*Logger) LogIn

func (l *Logger) LogIn(id int64)

LogIn logs the log-in event

func (*Logger) LogOut

func (l *Logger) LogOut(id int64)

LogOut logs the log-out event

func (*Logger) PoolStat

func (l *Logger) PoolStat(
	stat *pgxpool.Stat,
)

PoolStat logs the pool stat

func (*Logger) RefreshToken

func (l *Logger) RefreshToken(id int64)

RefreshToken logs the refresh token event

func (*Logger) RegenerateUser2FARecoveryCodes

func (l *Logger) RegenerateUser2FARecoveryCodes(id int64)

RegenerateUser2FARecoveryCodes logs the regenerate user 2FA recovery codes event

func (*Logger) RemoveUserNoteTags

func (l *Logger) RemoveUserNoteTags(id, noteID int64)

RemoveUserNoteTags logs the remove user note tags event

func (*Logger) ResetPassword

func (l *Logger) ResetPassword(id int64)

ResetPassword logs the reset password event

func (*Logger) Revoke2FATOTP

func (l *Logger) Revoke2FATOTP(id int64)

Revoke2FATOTP logs the revoke 2FA TOTP event

func (*Logger) RevokeRefreshToken

func (l *Logger) RevokeRefreshToken(id int64)

RevokeRefreshToken logs the revoke refresh token event

func (*Logger) RevokeRefreshTokens

func (l *Logger) RevokeRefreshTokens(id int64)

RevokeRefreshTokens logs the revoke refresh tokens event

func (*Logger) SendEmailVerificationToken

func (l *Logger) SendEmailVerificationToken(id int64)

SendEmailVerificationToken logs the send email verification token event

func (*Logger) SendUser2FAEmailCode

func (l *Logger) SendUser2FAEmailCode(id int64)

SendUser2FAEmailCode logs the send user 2FA email code event

func (*Logger) Sent2FAEmailCode

func (l *Logger) Sent2FAEmailCode(email string)

Sent2FAEmailCode logs that the 2FA email code was sent successfully

func (*Logger) SentResetPasswordEmail

func (l *Logger) SentResetPasswordEmail(email string)

SentResetPasswordEmail logs that the reset password email was sent successfully

func (*Logger) SentVerificationEmail

func (l *Logger) SentVerificationEmail(email string)

SentVerificationEmail logs that the verification email was sent successfully

func (*Logger) SentWelcomeEmail

func (l *Logger) SentWelcomeEmail(email string)

SentWelcomeEmail logs that the welcome email was sent successfully

func (*Logger) ServerStarted

func (l *Logger) ServerStarted(port string)

ServerStarted logs a success message when the server starts

func (*Logger) ServingSwaggerUI

func (l *Logger) ServingSwaggerUI(docsPath string)

ServingSwaggerUI logs the serving swagger UI event

func (*Logger) SignUp

func (l *Logger) SignUp(id int64)

SignUp logs the sign-up event

func (*Logger) SyncByLastSyncedAt

func (l *Logger) SyncByLastSyncedAt(
	id int64,
	userTagsLastSyncedAt,
	userNotesLastSyncedAt *time.Time,
	refreshTokenID int64,
)

SyncByLastSyncedAt logs the sync by last synced at event

func (*Logger) SyncUserNoteVersions

func (l *Logger) SyncUserNoteVersions(id, noteID, latestNoteVersionID int64)

SyncUserNoteVersions logs the sync user note versions event

func (*Logger) SyncUserNotesByLastSyncedAt

func (l *Logger) SyncUserNotesByLastSyncedAt(
	id int64,
	lastSyncedAt *time.Time,
	refreshTokenID int64,
)

SyncUserNotesByLastSyncedAt logs the sync user notes by last synced at event

func (*Logger) SyncUserTagsByLastSyncedAt

func (l *Logger) SyncUserTagsByLastSyncedAt(
	id int64,
	lastSyncedAt *time.Time,
	refreshTokenID int64,
)

SyncUserTagsByLastSyncedAt logs the sync user tags by last synced at event

func (*Logger) UpdateProfile

func (l *Logger) UpdateProfile(id int64)

UpdateProfile logs the update profile event

func (*Logger) UpdateUserNote

func (l *Logger) UpdateUserNote(id, noteID int64)

UpdateUserNote logs the update user note event

func (*Logger) UpdateUserNoteArchive

func (l *Logger) UpdateUserNoteArchive(id, noteID int64, archive bool)

UpdateUserNoteArchive logs the update user note archive event

func (*Logger) UpdateUserNotePin

func (l *Logger) UpdateUserNotePin(id, noteID int64, pin bool)

UpdateUserNotePin logs the update user note pin event

func (*Logger) UpdateUserNoteStar

func (l *Logger) UpdateUserNoteStar(id, noteID int64, star bool)

UpdateUserNoteStar logs the update user note star event

func (*Logger) UpdateUserNoteTrash

func (l *Logger) UpdateUserNoteTrash(id, noteID int64, trash bool)

UpdateUserNoteTrash logs the update user note trash event

func (*Logger) UpdateUserTag

func (l *Logger) UpdateUserTag(id, tagID int64)

UpdateUserTag logs the update user tag event

func (*Logger) Verify2FATOTP

func (l *Logger) Verify2FATOTP(id int64)

Verify2FATOTP logs the verify 2FA TOTP event

func (*Logger) VerifyEmail

func (l *Logger) VerifyEmail(id int64)

VerifyEmail logs the verify email event

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL