# game_log **Repository Path**: raincoldl/game_log ## Basic Information - **Project Name**: game_log - **Description**: 游戏服务器通用的日志app - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-03-23 - **Last Updated**: 2025-03-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: Erlang ## README game_log ===== 基于erlang原生log模块logger的游戏通用模型的log模块 构建项目 ----- $ rebar3 compile 用法 ----- 1.将依赖添置到rebar.config的deps结构下。 file: rebar.config {deps, [ {game_log, {git, "https://gitee.com/raincoldl/game_log.git", {branch, "master"}}}]} 2.在启动log的时候提前设置好环境变量 start_game_log() -> % 必选,设置配置模块 application:set_env(game_log, game_config_mod, game_config), ok = game_log_app:start(?GAMP_APP), ok. 3.在启动app的下必须包含的接口 在game_config_mod配置的模块,比如这里的game_config 首先必须要有基础接口 game_config:get(Key)和 game_config:get(Key, Default) 然后下面必须要有的配置是: game_config:get(log_path) % 日志路径 可选项是: game_config:get(log_level) % 日志等级,默认使用warning 日志等级为logger默认等级 emergency alert critical error warning notice info debug game_config:get(log_console) % 是否将日志输出到console上,默认是false 可选项为 true | false