%% ---------------------------------------------------------------------------
%% @doc 游戏日志api
%% @author hek
%% @since  2016-09-22
%% @deprecated 本模块提供游戏日志api
%% ---------------------------------------------------------------------------
-module(lib_log_api).
-compile(export_all).
-include("server.hrl").
-include("figure.hrl").
-include("predefine.hrl").
-include("guild.hrl").
-include("goods.hrl").
-include("def_goods.hrl").
-include("arena.hrl").

%% 商城购买日志
log_consume(Type, MoneyType, PlayerStatus, NewPlayerStatus, #cost_log_about{type = 3, data=[GoodsId, GoodsNum],remark=Remark}) ->
    log_consume(Type, MoneyType, PlayerStatus, NewPlayerStatus, GoodsId, GoodsNum, Remark);

log_consume(Type, MoneyType, PlayerStatus, NewPlayerStatus, #cost_log_about{remark=Remark}) ->
    log_consume(Type, MoneyType, PlayerStatus, NewPlayerStatus, 0, 0, Remark);

log_consume(Type, MoneyType, PlayerStatus, NewPlayerStatus, About) ->
    log_consume(Type, MoneyType, PlayerStatus, NewPlayerStatus, 0, 0, About).

%% 货币消费日志
%% Type : 消费类型 atom 需要后台定义"产出消耗类型--产出类型"
%% MoneyType : 金钱类型 term  (coin, bcoin, gold, bgold)
%% PlayerStatus : 消费前的玩家状态  record
%% NewPlayerStatus : 消费后的玩家状态  record
%% About : 消费内容 string
log_consume(Type, MoneyType, PlayerStatus, NewPlayerStatus, GoodsTypeId, GoodsNum, About) ->
    NowTime = utime:unixtime(),
    ConsumeType = data_goods:get_consume_type(Type),
    Lv = PlayerStatus#player_status.figure#figure.lv,
    Vip = PlayerStatus#player_status.figure#figure.vip,
    if
        MoneyType =:= ?TYPE_COIN ->
            Cost_coin = PlayerStatus#player_status.coin - NewPlayerStatus#player_status.coin,
            Remain_coin = NewPlayerStatus#player_status.coin,
            Lv = NewPlayerStatus#player_status.figure#figure.lv,
            ConsumeRet =
            if 
                Type == equipment_star -> %% 装备进化自动购买
                    EquipCostCoin = list_to_integer(About),
                    if EquipCostCoin == Cost_coin ->
                            {false, data_goods:get_consume_type(equip_auto_buy_1)};
                        true ->
                            if Cost_coin > EquipCostCoin -> %% 分开记录
                                    CostCoin1 = round(Cost_coin - EquipCostCoin),
                                    {true, {EquipCostCoin, Remain_coin + CostCoin1, data_goods:get_consume_type(equip_auto_buy_1)}, {CostCoin1, Remain_coin, data_goods:get_consume_type(equip_auto_buy)}};
                                true ->
                                {false, data_goods:get_consume_type(equip_auto_buy)}
                            end
                    end;
                Type == equipment_strength -> %% 装备强化购买
                    {false, data_goods:get_consume_type(equip_stren_buy)};
                true ->
                    {false, ConsumeType}
            end,
            ta_agent_fire:coin_consume(NewPlayerStatus, [Cost_coin, ConsumeType]),
            case ConsumeRet of
                {false, NewConsumeType} ->
                    mod_log:add_log(log_consume_coin, [
                            NowTime, NewConsumeType, PlayerStatus#player_status.id, GoodsTypeId, GoodsNum, Cost_coin, Remain_coin, About, Lv, Vip]);
                {true, {EquipCost, Remain1, EquipConsumeType}, {CostCoin, Remain2, CoinConsumeType}} ->
                    mod_log:add_log(log_consume_coin, [
                            NowTime, EquipConsumeType, PlayerStatus#player_status.id, GoodsTypeId, GoodsNum, EquipCost, Remain1, About, Lv, Vip]),
                    mod_log:add_log(log_consume_coin, [
                            NowTime, CoinConsumeType, PlayerStatus#player_status.id, GoodsTypeId, GoodsNum, CostCoin, Remain2, About, Lv, Vip]);
                _ ->
                    skip
            end;
        MoneyType =:= ?TYPE_GFAME ->
            Cost_gfame = PlayerStatus#player_status.gfame - NewPlayerStatus#player_status.gfame,
            Remain_gfame = NewPlayerStatus#player_status.gfame,
            Lv = NewPlayerStatus#player_status.figure#figure.lv,
            mod_log:add_log(log_consume_gfame, [
                    NowTime, ConsumeType, PlayerStatus#player_status.id, GoodsTypeId, GoodsNum, Cost_gfame, Remain_gfame, About, Lv, Vip]);
        MoneyType =:= ?TYPE_GOLD orelse MoneyType =:= ?TYPE_BGOLD orelse MoneyType =:= ?TYPE_FGOLD->
            Cost_gold = PlayerStatus#player_status.gold - NewPlayerStatus#player_status.gold,
            Cost_bgold = PlayerStatus#player_status.bgold - NewPlayerStatus#player_status.bgold,
            Cost_fgold = PlayerStatus#player_status.fgold - NewPlayerStatus#player_status.fgold,
            Remain_gold = NewPlayerStatus#player_status.gold,
            Remain_bgold = NewPlayerStatus#player_status.bgold,
            Remain_fgold = NewPlayerStatus#player_status.fgold,
            Lv = NewPlayerStatus#player_status.figure#figure.lv,
            Cost_gold > 0 andalso ta_agent_fire:gold_consume(NewPlayerStatus, [Cost_gold, ConsumeType]),
            Cost_bgold > 0 andalso ta_agent_fire:bgold_consume(NewPlayerStatus, [Cost_bgold, ConsumeType]),
            mod_log:add_log(log_consume_gold, [
                    NowTime, ConsumeType, PlayerStatus#player_status.id, GoodsTypeId, GoodsNum, Cost_gold, Cost_bgold, Cost_fgold, Remain_gold, Remain_bgold, Remain_fgold, About, Lv, Vip]);
        MoneyType =:= ?TYPE_HONOUR ->
            ta_agent_fire:honour_consume(NewPlayerStatus,
                [max(0, PlayerStatus#player_status.honour - NewPlayerStatus#player_status.honour), ConsumeType]
            ),
            lib_log_api:log_cost_honour(Type, PlayerStatus, NewPlayerStatus, About);
        true -> skip
    end,
    ok.

%% 经验消费日志
log_consume_exp(Type, PlayerStatus, NewPlayerStatus, About) ->
    NowTime = utime:unixtime(),
    ConsumeType = data_goods:get_consume_type(Type),
    CostExp = PlayerStatus#player_status.exp - NewPlayerStatus#player_status.exp,
    RemainExp = NewPlayerStatus#player_status.exp,
    PlayerId = NewPlayerStatus#player_status.id,
    Lv = NewPlayerStatus#player_status.figure#figure.lv,
    mod_log:add_log(log_consume_exp, [NowTime, ConsumeType, PlayerId, Lv, CostExp, RemainExp, About]),
    ok.

%% 货币生产日志
%% Type : 生产类型 atom 需要后台定义"产出消耗类型--消耗类型"
%% MoneyType : 金钱类型 term  (coin, bcoin, gold, bgold)
%% PlayerStatus : 生产前的玩家状态  record
%% NewPlayerStatus : 生产后的玩家状态  record
%% About : 消费内容 string
%%【 注意】：这个方法在充值lib_recharge:pay_offline中，会模拟出PlayerStatus跟NewPlayerStatus
%% 因此，如果需要用到coin, bcoin, bgold, gold, id之外的数据，需要通知同步修改，否则影响充值处理
log_produce(Type, MoneyType, PlayerStatus, NewPlayerStatus, About) ->
    NowTime = utime:unixtime(),
    Lv = PlayerStatus#player_status.figure#figure.lv,
    Vip = PlayerStatus#player_status.figure#figure.vip,
    ProduceType = data_goods:get_produce_type(Type),
    case MoneyType of
        ?TYPE_COIN ->
            Got_coin = NewPlayerStatus#player_status.coin - PlayerStatus#player_status.coin,
            Remain_coin = NewPlayerStatus#player_status.coin,
            ta_agent_fire:coin_get(NewPlayerStatus, [Got_coin, ProduceType]),
            mod_log:add_log(log_produce_coin, [NowTime, ProduceType, PlayerStatus#player_status.id, Lv, Vip, Got_coin, Remain_coin, About]);
        ?TYPE_GFAME ->
            Got_gfame = NewPlayerStatus#player_status.gfame - PlayerStatus#player_status.gfame,
            Remain_gfame = NewPlayerStatus#player_status.gfame,
            mod_log:add_log(log_produce_gfame, [NowTime, ProduceType, PlayerStatus#player_status.id, Lv, Vip, Got_gfame, Remain_gfame, About]);
        ?TYPE_CURRENCY ->
            {CurrencyId, Remark} = About,
            OldC = maps:get(CurrencyId, PlayerStatus#player_status.currency_map, 0),
            NewC = maps:get(CurrencyId, NewPlayerStatus#player_status.currency_map, 0),
            GotCurrency = NewC - OldC,
            mod_log:add_log(log_produce_currency, [NowTime, ProduceType, PlayerStatus#player_status.id, Lv, Vip, CurrencyId, GotCurrency, NewC, Remark]);
        ?TYPE_VIP_EXP ->
            OldC = lib_vip:get_total_vip_exp(PlayerStatus#player_status.vip_status),
            NewC = lib_vip:get_total_vip_exp(NewPlayerStatus#player_status.vip_status),
            GotCurrency = NewC - OldC,
            mod_log:add_log(log_produce_currency, [NowTime, ProduceType, PlayerStatus#player_status.id, Lv, Vip, ?TYPE_VIP_EXP, GotCurrency, NewC, ""]);
        _ when MoneyType =:= ?TYPE_GOLD orelse MoneyType =:= ?TYPE_BGOLD orelse MoneyType =:= ?TYPE_FGOLD ->
            Got_gold = NewPlayerStatus#player_status.gold - PlayerStatus#player_status.gold,
            Got_bgold = NewPlayerStatus#player_status.bgold - PlayerStatus#player_status.bgold,
            Got_fgold = NewPlayerStatus#player_status.fgold - PlayerStatus#player_status.fgold,
            Remain_gold = NewPlayerStatus#player_status.gold,
            Remain_bgold = NewPlayerStatus#player_status.bgold,
            Remain_fgold = NewPlayerStatus#player_status.fgold,
            Got_gold > 0 andalso ta_agent_fire:gold_get(NewPlayerStatus, [Got_gold, ProduceType]),
            mod_log:add_log(log_produce_gold, [
                    NowTime, ProduceType, PlayerStatus#player_status.id, Lv, Vip, Got_gold, Got_bgold, Got_fgold, Remain_gold, Remain_bgold, Remain_fgold, About]);
        _ -> skip
    end,
    ok.

%% 物品使用日志
log_throw(List) ->
    case List=/=[] of
        true -> mod_log:add_log(log_throw, List);
        false -> skip
    end,
    ok.

log_throw(Type, PlayerId, GoodsId, GoodsTypeId, GoodsNum, _Prefix, _Stren) ->
    TypeId = data_goods:get_consume_type(Type),
    mod_log:add_log(log_throw, [utime:unixtime(), TypeId, PlayerId, GoodsId, GoodsTypeId, GoodsNum]),
    ok.

%% 物品产出日志
log_goods(LogList) ->
    case LogList=/=[] of
        true -> mod_log:add_log(log_goods, LogList);
        false -> skip
    end,
    ok.

log_goods(Type, SubType, GoodsTypeId, GoodsNum, PlayerId, Remark) ->
    TypeId = data_goods:get_produce_type(Type),
    mod_log:add_log(log_goods, [utime:unixtime(), TypeId, SubType, GoodsTypeId, GoodsNum, PlayerId, Remark]),
    ok.

%% 礼包日志
log_gift(PlayerId, GoodsId, GoodsTypeId, GiftId, UseNum, About) ->
    NowTime = utime:unixtime(),
    mod_log:add_log(log_gift, [NowTime, PlayerId, GoodsId, GoodsTypeId, GiftId, UseNum]),
    GiftAbout = [[NowTime, PlayerId, GiftId, Id, Num]||{Id, Num}<-About, Num>0],
    case GiftAbout=/=[] of
        true ->
            mod_log:add_log(log_gift_about, GiftAbout);
        false -> skip
    end,
    ok.

log_common_rank_role(RoleId, RankType, Rank, Value, SecRoleId, SecValue) ->
    mod_log:add_log(log_common_rank_role, [RoleId, RankType, Rank, Value, SecRoleId, SecValue, utime:unixtime()]),
    ok.
%% 公会榜结算日志
log_common_rank_guild(GuildId, Rank, Combat, SecGuildId, SecCombat) ->
    mod_log:add_log(log_common_rank_guild, [GuildId, Rank, Combat, SecGuildId, SecCombat, utime:unixtime()]),
    ok.

%% 成就领取日志
log_achv(PlayerId, Lv, Type, SubType, Id) ->
    mod_log:add_log(log_achv, [PlayerId, Lv, Type, SubType, Id, utime:unixtime()]),
    ok.

%% 称号激活日志
log_active_dsgt(PlayerId, Id, Op, OpNow, ExpireTime, EndTime, ReturnMoney) ->
    mod_log:add_log(log_active_dsgt, [PlayerId, Id, Op, OpNow, ExpireTime, EndTime, util:term_to_bitstring(ReturnMoney)]),
    ok.

%% 活动日志
log_act_reward(RoleId, Type, Subtype, RewardId, Count, CTime, UTime) ->
    mod_log:add_log(log_act_reward, [utime:unixtime(), RoleId, Type, Subtype, RewardId, Count, CTime, UTime]).

log_activity_live(RoleId, Lv, ComPower, AcId, AcSub, AcName, Live, OldLive, NewLive, Time) ->
    mod_log:add_log(log_activity_live, [RoleId, Lv, ComPower, AcId, AcSub, AcName, Live, OldLive, NewLive, Time]),
    ok.

log_shop(RoleId, Lv, VipLv, ShopType, GoodsId, AllNum, BuyNum, CType, AllPrice, Time) ->
    mod_log:add_log(log_shop, [RoleId, Lv, VipLv, ShopType, GoodsId, AllNum, BuyNum, CType, AllPrice, Time]),
    ok.
%% 功能活动参与记录、日志
join_log(PlayerId, GuildId, ModuleId) ->
    NowTime = utime:unixtime(),
    mod_log:add_log(log_join, [PlayerId, GuildId, ModuleId, NowTime]),
    ok.

log_auction_produce(ModuleId, AuctionType, AuctionId, GuildGoodsList) ->
    {NewModuleId, SubModuleId} = lib_auction_data:get_module_submodule(ModuleId),
    Time = utime:unixtime(),
    Args = [[GuildId, NewModuleId, SubModuleId, AuctionType, AuctionId, util:term_to_bitstring(GoodsList), TaxRate, Time]||{GuildId, TaxRate, GoodsList}<-GuildGoodsList],
    mod_log:add_log(log_auction_produce, Args),
    ok.

log_auction_pay(PlayerId, GuildId, ModuleId, AuctionType, GoodsId, TypeId, GoodsNum, PayType, PriceList, Price) ->
    {NewModuleId, SubModuleId} = lib_auction_data:get_module_submodule(ModuleId),
    Time = utime:unixtime(),
    PriceList2 = util:term_to_bitstring(PriceList),
    mod_log:add_log(log_auction_pay, [PlayerId, GuildId, NewModuleId, SubModuleId, AuctionType, GoodsId, TypeId, GoodsNum, PayType, PriceList2, Price,  Time]),
    ok.

log_auction_award(PlayerId, GuildId, ModuleId, AuctionType, GoodsId, TypeId, GoodsNum, Price) ->
    {NewModuleId, SubModuleId} = lib_auction_data:get_module_submodule(ModuleId),
    Time = utime:unixtime(),
    mod_log:add_log(log_auction_award, [PlayerId, GuildId, NewModuleId, SubModuleId, AuctionType, GoodsId, TypeId, GoodsNum, Price, Time]),
    ok.

log_auction_bonus(PlayerId, GuildId, ModuleId, MoneyList) ->
    {NewModuleId, SubModuleId} = lib_auction_data:get_module_submodule(ModuleId),
    Time = utime:unixtime(),
    MoneyList2 = util:term_to_bitstring(MoneyList),
    mod_log:add_log(log_auction_bonus, [PlayerId, GuildId, NewModuleId, SubModuleId, MoneyList2, Time]),
    ok.

log_personal_auction(PlayerId, GoodsId, TypeId, GoodsNum, CtrlType, AuctionStatus, TopPlayerId, Price, CloseTime) ->
    mod_log:add_log(log_personal_auction, [PlayerId, GoodsId, TypeId, GoodsNum, CtrlType, AuctionStatus, TopPlayerId, Price, CloseTime, utime:unixtime()]),
    ok.

log_ac_start(Module, ModuleSub, AcSub, State, Time) ->
    mod_log:add_log(log_ac_start, [Module, ModuleSub, AcSub, State, Time]),
    ok.

log_custom_act(Type, Subtype, WLv, Stime, Etime, State, Time) ->
    mod_log:add_log(log_custom_act, [Type, Subtype, WLv, Stime, Etime, State, Time]),
    ok.

log_custom_act_reward(RoleId, Type, Subtype, Grade, WLv, Reward, Extra, Vip, Lv, GoldOld, GoldNew, BGoldOld, BGoldNew, Time) ->
    RewardStr = util:term_to_string(Reward),
    ExtraBin = util:make_sure_binary(Extra),
    mod_log:add_log(log_custom_act_reward, [RoleId, Type, Subtype, Grade, WLv, RewardStr, ExtraBin, Vip, Lv, GoldOld, GoldNew, BGoldOld, BGoldNew, Time]),
    ok.

log_daily_gift(RoleId, ProductName, GoodsTypeId, Time) ->
    mod_log:add_log(log_daily_gift, [RoleId, ProductName, GoodsTypeId, Time]),
    ok.

log_resource_back(RoleId, Id, ActSub, Cost, Times, LeftTimes, Reward) ->
    Cost_B = util:term_to_bitstring(Cost),
    Reward_B = util:term_to_bitstring(Reward),
    mod_log:add_log(log_resource_back, [RoleId, Id, ActSub, Cost_B, Times, LeftTimes, Reward_B, utime:unixtime()]),
    ok.

log_uplv(PlayerId, Lv, Turn, From, ExpAdd, ExpList, LvMaxExp, Power) ->
    mod_log:add_log(log_uplv, [PlayerId, Lv, Turn, From, ExpAdd, util:term_to_bitstring(ExpList), LvMaxExp, Power, utime:unixtime()]),
    ok.


log_login_logout(PlayerId, Type, Lv, Power, SceneId, Ip, NetWorkType, Accid, Accname) ->
    mod_log:add_log(log_login_logout, [PlayerId, Type, utime:unixtime(), Lv, Power, SceneId, Ip, NetWorkType, Accid, Accname]),
    ok.

log_coin_exchange(RoleId, VipLv, AlreadyExchanged, CanExchange, Cost, Reward, Time) ->
    mod_log:add_log(log_coin_exchange, [RoleId, VipLv, AlreadyExchanged, CanExchange, Cost, Reward, Time]),
    ok.

log_goods_sell(PlayerId, GoodsTypeList, GoodsIdList, ObjectList) ->
    mod_log:add_log(log_goods_sell, [PlayerId, util:term_to_bitstring(GoodsTypeList), util:term_to_bitstring(GoodsIdList), util:term_to_bitstring(ObjectList), utime:unixtime()]),
    ok.

log_growup(RoleId, SubType, Lv, Num, GetTime, BuyTime) ->
    mod_log:add_log(log_growup, [RoleId, SubType, Lv, Num, GetTime, BuyTime]),
    ok.

%% 消耗资金日志
log_consume_gfunds(RoleId, GuildId, Type, CostGfunds, RemainGfunds, Time) ->
    ConsumeType = data_goods:get_consume_type(Type),
    mod_log:add_log(log_consume_gfunds, [RoleId, GuildId, ConsumeType, CostGfunds, RemainGfunds, Time]).

%% 增加资金日志
log_produce_gfunds(RoleId, GuildId, Type, AddGfunds, RemainGfunds, Time) ->
    ProduceType = data_goods:get_produce_type(Type),
    mod_log:add_log(log_produce_gfunds, [RoleId, GuildId, ProduceType, AddGfunds, RemainGfunds, Time]).

%% 首冲日志
log_recharge_first(PlayerId, Name, ProductId, LogType, Day, Award, IsSameDay, RegTime, Opday, LastBehavior, Lv, OnlineTime) ->
    mod_log:add_log(log_recharge_first, [PlayerId, Name, ProductId, LogType, Day, util:term_to_bitstring(Award), IsSameDay, RegTime, Opday, LastBehavior, Lv, OnlineTime, utime:unixtime()]),
    ok.

%% 充值返利日志
log_recharge_return(PlayerId, ProductId, ReturnType, Gold, ReturnGold, Time) ->
    mod_log:add_log(log_recharge_return, [PlayerId, ProductId, ReturnType, Gold, ReturnGold, Time]),
    ok.

%% 快速充值
log_quick_recharge(PlayerId, ProductId, Gold, MoneyGap, Time) ->
    mod_log:add_log(log_quickcharge, [PlayerId, ProductId, Gold, MoneyGap, Time]).

%% 禁言日志
%% Type: 0：封号，1：IP黑名单，3：禁言 4：解除禁言
log_ban(Type, Object, Description, Time, Admin) ->
    mod_log:add_log(log_ban, [Type, Object, Description, Time, Admin]),
    ok.

log_rename(RoleId,OldName,NewName,Lv,Cost) ->
    mod_log:add_log(log_rename, [RoleId, OldName, NewName, Lv, util:term_to_bitstring(Cost), utime:unixtime()]),
    ok.

log_gift_card_list(PlayerId, CardNo, CardType, GiftType, AwardList, CostGoods, IsSuccess) ->
    mod_log:add_log(log_gift_card_list, [PlayerId, CardNo, CardType, GiftType, util:term_to_bitstring(AwardList), util:term_to_bitstring(CostGoods), IsSuccess, utime:unixtime()]),
    ok.


log_top_pk(RoleId, OtherRoleId, OtherName, IsFake, Platform, ServerId, Res, ScoreBefore, ScoreAfter) ->
    mod_log:add_log(log_top_pk, [RoleId, OtherRoleId, OtherName, IsFake, Platform, ServerId, Res, ScoreBefore, ScoreAfter, utime:unixtime()]),
    ok.

log_consume_currency(PlayerId, Lv, VipLv, Type, CurrencyId, Num, NewValue, About) ->
    TypeId = data_goods:get_consume_type(Type),
    mod_log:add_log(log_consume_currency, [PlayerId, Lv, VipLv, TypeId, CurrencyId, Num, NewValue, About, utime:unixtime()]),
    ok.
%% 聊天举报
log_talk_report(FromId, ToId, Msg, Time) ->
    mod_log:add_log(log_talk_report, [FromId, ToId, Msg, Time]),
    ok.

%% 七天登录领取
log_login_reward_day(RoleId, DayId, GetDate, Now, RewardList) ->
    SRewardList = util:term_to_bitstring(RewardList),
    mod_log:add_log(log_login_reward_day, [RoleId, DayId, GetDate, SRewardList, Now]),
    ok.

%% 转职日志
log_transform(RoleId, Turn, TaskId, Lv) ->
    mod_log:add_log(log_transform, [RoleId, Turn, TaskId, Lv, utime:unixtime()]),
    ok.

%% 市场上架日志
log_sell_up(SellerId, SellType, SellId, GoodsId, GoodsNum, UnitPrice, SpecifyerId, Extra) ->
    ExtraStr = util:term_to_bitstring(Extra),
    mod_log:add_log(log_sell_up, [SellerId, SellType, SellId, GoodsId, GoodsNum, UnitPrice, SpecifyerId, ExtraStr, utime:unixtime()]),
    ok.

%% 市场交易日志
log_sell_pay(SellType, SellId, GoodsId, GoodsNum, UnitPrice, Tax, SellerId, BuyerId, Extra) ->
    ExtraStr = util:term_to_bitstring(Extra),
    mod_log:add_log(log_sell_pay, [SellType, SellId, GoodsId, GoodsNum, UnitPrice, Tax, SellerId, BuyerId, ExtraStr, utime:unixtime()]),
    ok.

%% 市场下架日志
log_sell_down(SellId, GoodsId, GoodsNum, SellerId, DownType, Extra) ->
    ExtraStr = util:term_to_bitstring(Extra),
    mod_log:add_log(log_sell_down, [SellId, GoodsId, GoodsNum, SellerId, DownType, ExtraStr, utime:unixtime()]),
    ok.

%% 上传头像日志
log_picture(RoleId, Picture, PictureVer) ->
    mod_log:add_log(log_picture, [RoleId, Picture, PictureVer, utime:unixtime()]),
    ok.

%% 更改本地头像日志
log_local_picture(RoleId,ProfilePhotoId) ->
    mod_log:add_log(log_local_picture,[RoleId,ProfilePhotoId,utime:unixtime()]),
    ok.

%% 时装激活日志
log_fashion_activate(RoleId, PosId, FashionId, ColorId, Type, CostList, OldTime, NewTime) ->
    SCostList = util:term_to_bitstring(CostList),
    mod_log:add_log(log_fashion_activate, [RoleId, PosId, FashionId, ColorId, Type, SCostList, OldTime, NewTime, utime:unixtime()]),
    ok.

%% 时装染色/解锁颜色日志
log_fashion_color(RoleId, PosId, FashionId, ColorId, Type, CostList) ->
    SCostList = util:term_to_bitstring(CostList),
    mod_log:add_log(log_fashion_color, [RoleId, PosId, FashionId, ColorId, Type, SCostList, utime:unixtime()]),
    ok.

%% 时装激活/升星日志
log_fashion_star(RoleId, PosId, FashionId, ColorId, Type, OldStarLv, NewStarLv, CostList) ->
    SCostList = util:term_to_bitstring(CostList),
    mod_log:add_log(log_fashion_star, [RoleId, PosId, FashionId, ColorId, Type, OldStarLv, NewStarLv, SCostList, utime:unixtime()]),
    ok.

%% 装扮激活升星日志
log_dress_star(RoleId, DressType, DressId, DressLv, DressExp, Cost) ->
    CostStr = util:term_to_bitstring(Cost),
    mod_log:add_log(log_dress_star, [RoleId, DressType, DressId, DressLv, DressExp, CostStr, utime:unixtime()]),
    ok.

%% 装扮图鉴升级日志
log_dress_illu_lv(RoleId, IlluLv, IlluExp, NewIlluLv, NewIlluExp, Cost) ->
    CostStr = util:term_to_bitstring(Cost),
    mod_log:add_log(log_dress_illu_lv, [RoleId, IlluLv, IlluExp, NewIlluLv, NewIlluExp, CostStr, utime:unixtime()]),
    ok.


%% 物品兑换日志
log_goods_exchange(RoleId, Type, Cost, Reward) ->
    CostStr = util:term_to_bitstring(Cost),
    RewardStr = util:term_to_bitstring(Reward),
    mod_log:add_log(log_goods_exchange, [RoleId, Type, CostStr, RewardStr, utime:unixtime()]),
    ok.

%% 活跃度外形升级日志
log_liveness_up(RoleId, PreLv, Liveness, AfterLv) ->
    mod_log:add_log(log_liveness_up, [RoleId, PreLv, Liveness, AfterLv, utime:unixtime()]),
    ok.

%% 荣誉值产出日志
log_produce_honour(Type, Ps, NewPS, Remark) ->
    ProduceType = data_goods:get_produce_type(Type),
    OldH = Ps#player_status.honour,
    NewH = NewPS#player_status.honour,
    GotH = max(NewH - OldH, 0),
    ta_agent_fire:honour_get(NewPS, [GotH, ProduceType, Remark]),
    mod_log:add_log(log_produce_honour, [Ps#player_status.id, ProduceType, OldH, NewH, GotH, Remark, utime:unixtime()]),
    ok.

%% 荣誉值消耗日志
log_cost_honour(Type, Ps, NewPS, Remark) ->
    if
        Type == equipment_star ->
            ProduceType = data_goods:get_consume_type(equip_auto_buy);
        Type == equipment_strength ->
            ProduceType = data_goods:get_consume_type(equip_stren_buy);
        true ->
            ProduceType = data_goods:get_consume_type(Type)
    end,
    OldH = Ps#player_status.honour,
    NewH = NewPS#player_status.honour,
    CostH = max(OldH - NewH, 0),
    mod_log:add_log(log_cost_honour, [Ps#player_status.id, ProduceType, OldH, NewH, CostH, Remark, utime:unixtime()]),
    ok.

%% 开服冲榜排行日志
log_rush_rank_reward(RoleId, RankType, Rank, Value, Reward) ->
    RewardStr = util:term_to_bitstring(Reward),
    mod_log:add_log(log_rush_rank_reward, [RoleId, RankType, Rank, Value, RewardStr, utime:unixtime()]),
    ok.

%% 开服冲榜目标日志
log_rush_goal_reward(RoleId, RankType, GoalId, Value, Reward) ->
    RewardStr = util:term_to_bitstring(Reward),
    mod_log:add_log(log_rush_goal_reward, [RoleId, RankType, GoalId, Value, RewardStr, utime:unixtime()]),
    ok.

%% 后台删除邮件日志
log_mail_clear(RoleId, Title, CmAttachment, State, EffectSt) ->
    mod_log:add_log(log_mail_clear, [RoleId, Title, CmAttachment, State, EffectSt, utime:unixtime()]),
    ok.

%% 社交关系日志
log_rela(RoleId, OtherRoleId, PreRela, CtrlType, Rela) ->
    mod_log:add_log(log_rela, [RoleId, OtherRoleId, PreRela, CtrlType, Rela, utime:unixtime()]),
    ok.

%% 亲密度日志
log_intimacy(RoleId, OtherRoleId, PreIntimacy, ObtainWay, CurIntimacy, Extra) ->
    ExtraStr = util:term_to_bitstring(Extra),
    mod_log:add_log(log_intimacy, [RoleId, OtherRoleId, PreIntimacy, ObtainWay, CurIntimacy, ExtraStr, utime:unixtime()]),
    ok.

%% 公会贡献产出日志
log_produce_gdonate(RoleId, Type, AddGDonate, RemainGDonate, HGDonate, Extra) ->
    ProduceType = data_goods:get_produce_type(Type),
    mod_log:add_log(log_produce_gdonate, [RoleId, ProduceType, AddGDonate, RemainGDonate, HGDonate, Extra, utime:unixtime()]).

%% 公会贡献消耗日志
log_consume_gdonate(RoleId, Type, CostGDonate, RemainGDonate, Extra) ->
    ConsumeType = data_goods:get_consume_type(Type),
    mod_log:add_log(log_consume_gdonate, [RoleId, ConsumeType, CostGDonate, RemainGDonate, Extra, utime:unixtime()]).

%% 公会成长值产出日志
log_produce_growth(GuildId, RoleId, Type, AddGrowth, NewGrowth) ->
    ProduceType = data_goods:get_produce_type(Type),
    mod_log:add_log(log_produce_growth, [GuildId, RoleId, ProduceType, AddGrowth, NewGrowth, utime:unixtime()]).

%% 公会成长值消耗日志
log_consume_growth(GuildId, RoleId, Type, CostGrowth, RemainGrowth, Extra) ->
    ConsumeType = data_goods:get_consume_type(Type),
    mod_log:add_log(log_consume_growth, [GuildId, RoleId, ConsumeType, CostGrowth, RemainGrowth, Extra, utime:unixtime()]).

%% 社团创建解散日志
log_guild(GuildId, GuildName, Flag, CreateLv, RoleID, RoleLv, Name, Vip, OpTy, CreateCost0)->
    CreateCost = util:term_to_bitstring(CreateCost0),
    mod_log:add_log(log_guild, [GuildId, GuildName, Flag, CreateLv, RoleID, RoleLv, Name, Vip, OpTy, CreateCost, utime:unixtime()]).

%% 社团成员日志
log_guild_member(GuildId, GuildName, EventType, RoleId, EventParam, Time) ->
    mod_log:add_log(log_guild_member, [GuildId, GuildName, EventType, RoleId, EventParam, Time]).
%%社团等级
log_guild_lv(GuildId,GName,ChiefId,ChiefName,Glv,NGlv)->
    mod_log:add_log(log_guild_lv, [GuildId,GName,ChiefId,ChiefName,Glv,NGlv, utime:unixtime()]).
%%社团改名
log_rename_guild(GuildId, RoleId, RName, OGName, NGName,OFlag,NFlag, Cost0) ->
    Cost = util:term_to_bitstring(Cost0),
    mod_log:add_log(log_guild_rename, [GuildId, RoleId, RName, OGName, NGName,OFlag,NFlag, Cost, utime:unixtime()]),
    ok.

%%社团合并
log_guild_merge(GuildID,AName,AChiefId,AChiefName,ANum,OpTy,Target,BName,BLives,BNum,Days)->
    mod_log:add_log(log_guild_merge, [GuildID,AName,AChiefId,AChiefName,ANum,OpTy,Target,BName,BLives,BNum,Days, utime:unixtime()]),
    ok.

%%社团活跃度领取
log_guild_lives_award(GuildId,GName,RoleID,RName,Total,Need,Awards0)->
    Awards = util:term_to_bitstring(Awards0),
    mod_log:add_log(log_guild_lives_award, [GuildId,GName,RoleID,RName,Total,Need,Awards, utime:unixtime()]),
    ok.

%%派单日志
log_guild_order(GuildId,GName,RoleID,RName,OpTy,OrderId,Color,MNum,Teams0,Awards0)->
    Awards = util:term_to_bitstring(Awards0),
    Teams = util:term_to_bitstring(Teams0),
    mod_log:add_log(log_guild_order, [GuildId,GName,RoleID,RName,OpTy,OrderId,Color,MNum,Teams,Awards, utime:unixtime()]),
    ok.

%% 红包日志
log_red_envelopes(RedEnvelopesId, OwnershipType, OwnershipId, OwnerId, Status, Type, Extra) ->
    ExtraStr = util:term_to_bitstring(Extra),
    mod_log:add_log(log_red_envelopes, [RedEnvelopesId, OwnershipType, OwnershipId, OwnerId, Status, Type, ExtraStr, utime:unixtime()]).

%% 红包领取日志
log_red_envelopes_recipients(RoleId, RedEnvelopesId, Reward) ->
    RewardStr = util:term_to_bitstring(Reward),
    mod_log:add_log(log_red_envelopes_recipients, [RoleId, RedEnvelopesId, RewardStr, utime:unixtime()]).

%% 公会技能日志
log_guild_skill(RoleId, RoleLv, GuildId, GuildLv, BuildingLv, SkillId, SkillLv, NewSkillLv, Cost, OldPower, NewPower) ->
    mod_log:add_log(log_guild_skill, [RoleId, RoleLv, GuildId, GuildLv, BuildingLv, SkillId, SkillLv, NewSkillLv, Cost, OldPower, NewPower, utime:unixtime()]).

%% 砸蛋日志
log_smashed_egg(RoleId, SmashedType, SmashedEggNum, Index, FreeTimesLogTag, AutoBuy, CostL, RewardL) ->
    CostStr = util:term_to_bitstring(CostL),
    RewardStr = util:term_to_bitstring(RewardL),
    mod_log:add_log(log_smashed_egg, [RoleId, SmashedType, SmashedEggNum, Index, FreeTimesLogTag, AutoBuy, CostStr, RewardStr, utime:unixtime()]).

%% 云购日志
log_cloud_buy_kf(Values) ->
    mod_log:add_log(log_cloud_buy_kf, Values).

%% 转职日志
log_transfer(RoleId, OldCareer, OldSex, NewCareer, NewSex) ->
    mod_log:add_log(log_transfer, [RoleId, OldCareer, OldSex, NewCareer, NewSex, utime:unixtime()]).

%% 幸运鉴宝
log_treasure_evaluation(RoleId, Type, OldLuckyNum, NewLuckyNum, CostList, RewardList) ->
    mod_log:add_log(log_treasure_evaluation, [RoleId, Type, OldLuckyNum, NewLuckyNum, CostList, RewardList, utime:unixtime()]).

%% 收集活动日志
log_collect_put(SubType, AllRewardId, AllRewardType, NewAllPoint, RoleId, PutType, SelfRewardId, SelfRewardType, NewSelfPoint) ->
    mod_log:add_log(log_collect_put, [SubType, AllRewardId, AllRewardType, NewAllPoint, RoleId, PutType, SelfRewardId, SelfRewardType, NewSelfPoint, utime:unixtime()]).

%% 0元豪礼日志
log_login_return_reward(RoleId, SubType, Grade, Status, Cost, Reward) ->
    CostStr = util:term_to_string(Cost),
    RewardStr = util:term_to_string(Reward),
    mod_log:add_log(log_login_return_reward, [RoleId, SubType, Grade, Status, CostStr, RewardStr, utime:unixtime()]).

%% 服务器节点日志
log_server_open(ServerStatus, ServerType, Node, ServerId, ServerNum, Platform, BeginTime, EndTime, CostTime) ->
    mod_log:add_log(log_server_open, [ServerStatus, ServerType, Node, ServerId, ServerNum, Platform, BeginTime, EndTime, CostTime, utime:unixtime()]),
    ok.

%% 服务器日清日志
log_server_daily_clear(LogType, BeginTime, EndTime) ->
    mod_log:add_log(log_server_daily_clear, [LogType, BeginTime, EndTime, max(EndTime - BeginTime, 0), utime:unixtime()]),
    ok.

%% 服务器热更日志
log_server_hot(ModuleList, BeginTime, EndTime) ->
    mod_log:add_log(log_server_hot, [util:term_to_bitstring(ModuleList), BeginTime, EndTime, max(EndTime - BeginTime, 0), utime:unixtime()]),
    ok.

%% 服务器内存日志
log_server_memory(MemoryTotal, MemoryProcesses, MemoryAtom, MemoryBinary, MemoryCode, MemoryEts, ProcessCNT, EtsCNT, PortCNT) ->
    mod_log:add_log(log_server_memory, [MemoryTotal, MemoryProcesses, MemoryAtom, MemoryBinary, MemoryCode, MemoryEts, ProcessCNT, EtsCNT, PortCNT, utime:unixtime()]),
    ok.

%% 服务器web_interface日志
log_server_interface(MFA, BeginTime, EndTime) ->
    mod_log:add_log(log_server_interface, [MFA, BeginTime, EndTime, max(EndTime - BeginTime, 0), utime:unixtime()]),
    ok.


log_3v3_pk_room(SceneId, ScenePoolId, RoomId, TowerDataF, PkId, Result, BName1, BName2, BName3, BScore,
                BTowerNum, RName1, RName2, RName3, RScore, RTowerNum) ->
    mod_log:add_log(log_3v3_pk_room, [SceneId, ScenePoolId, RoomId, util:term_to_string(TowerDataF), PkId, Result, BName1, BName2, BName3, BScore,
                                      BTowerNum, RName1, RName2, RName3, RScore, RTowerNum, utime:unixtime()]).

log_3v3_pk_team(PkId, TeamId, Group, Score, Kill, Killed, Assist, Result) ->
    mod_log:add_log(log_3v3_pk_team, [PkId, TeamId, Group, Score, Kill, Killed, Assist, Result, utime:unixtime()]).

log_3v3_pk_role(PkId, RoleId, Name, Group, OldTier, OldStar, OldContinuedWin, NewTier, NewStar, NewContinuedWin,
                Kill, Killed, Collect, Assist, Honor, IsMvp, Result) ->
    mod_log:add_log(log_3v3_pk_role, [PkId, RoleId, Name, Group, OldTier, OldStar, OldContinuedWin, NewTier, NewStar, NewContinuedWin,
                                      Kill, Killed, Collect, Assist, Honor, IsMvp, Result, utime:unixtime()]).

log_3v3_rank_reward(RankID, RoleID, Nickname, Tier, Star, Reward) ->
    mod_log:add_log(log_3v3_rank_reward, [RankID, RoleID, Nickname, Tier, Star, util:term_to_string(Reward), utime:unixtime()]).

log_3v3(RoleID, Type, OldTier, OldStar, Tier, Star, Result, Honor) ->
    mod_log:add_log(log_3v3, [RoleID, Type, OldTier, OldStar, Tier, Star, Result, Honor, utime:unixtime()]).

log_drum_war(DrumID, WZone, WWar, WRoleID, WName, WSId, WPlat, WSnum, WLive, WPower, LRoleID, LName, LSId, LPlat, LSnum, LLive, LPower, Type) ->
    mod_log:add_log(log_drum_war, [DrumID, WZone, WWar, WRoleID, WName, WSId, WPlat, WSnum, WLive, WPower, LRoleID, LName, LSId, LPlat, LSnum, LLive, LPower, Type, utime:unixtime()]),
    ok.

log_drum_sign(Name,RoleId, Lv) ->
    mod_log:add_log(log_drum_sign, [Name,RoleId, Lv, utime:unixtime()]),
    ok.

log_drum_cost(RoleId, Type, Cost) ->
    mod_log:add_log(log_drum_cost, [RoleId, Type, util:term_to_bitstring(Cost), utime:unixtime()]),
    ok.

log_drum_refuce(Node,RoleID,Sid,Power) ->
    mod_log:add_log(log_drum_refuce, [Node, RoleID, Sid, Power, utime:unixtime()]),
    ok.

log_drum_refuce_mail(RoleID) ->
    mod_log:add_log(log_drum_refuce_mail, [RoleID, utime:unixtime()]),
    ok.

%% 跨服1vn拍卖
log_kf_1vn_auction(AuctionId, Id, SerId, SerNum, Name, PriceAdd, Price, VoucherAdd) ->
    mod_log:add_log(log_kf_1vn_auction, [AuctionId, Id, SerId, SerNum, Name, PriceAdd, Price, VoucherAdd, utime:unixtime()]),
    ok.

%% 跨服1vn资格赛
log_kf_1vn_race_1(Area, IdA, SerIdA, SerNumA, NameA, CPA, ScoreA, IdB, SerIdB, SerNumB, NameB, CPB, ScoreB, EndType) ->
    mod_log:add_log(log_kf_1vn_race_1, [Area, IdA, SerIdA, SerNumA, NameA, CPA, ScoreA, IdB, SerIdB, SerNumB, NameB, CPB, ScoreB, EndType, utime:unixtime()]),
    ok.

%% 跨服1vn挑战赛
log_kf_1vn_race_2(Area, MatchTurn, BattleId, Id, ServerId, SerNum, Name, CP, DefType, SidBWin, EndType, IsDead) ->
    mod_log:add_log(log_kf_1vn_race_2, [Area, MatchTurn, BattleId, Id, ServerId, SerNum, Name, CP, DefType, SidBWin, EndType, IsDead, utime:unixtime()]),
    ok.

%% 跨服1vn报名
log_kf_1vn_sign(Id, ServerId, Lv, Name) ->
    mod_log:add_log(log_kf_1vn_sign, [Id, Name, ServerId, Lv, utime:unixtime()]),
    ok.

%% 跨服1vn竞猜
log_kf_1vn_bet(RoleId, RoleName, Turn, BattleId, BetSide, Money, Time) ->
    mod_log:add_log(log_kf_1vn_bet, [RoleId, RoleName, Turn, BattleId, BetSide, Money, Time]),
    ok.

%% 钓鱼购买渔具
log_buy_fishing_gear(RoleId, RoleLv, VipLv, FishingGear, Cost) ->
    mod_log:add_log(log_buy_fishing_gear, [RoleId, RoleLv, VipLv, util:term_to_bitstring(FishingGear), util:term_to_bitstring(Cost), utime:unixtime()]),
    ok.

%% 钓鱼收获
log_fishing_harvest(RoleId, RoleLv, SceneId, FishingLv, WaterArea, FishingId, Type, MaunalOrAuto, RodsCost, EnergyValue, ReCode) ->
    mod_log:add_log(log_fishing_harvest, [RoleId, RoleLv, SceneId, FishingLv, WaterArea, FishingId, Type, MaunalOrAuto, RodsCost, EnergyValue, ReCode, utime:unixtime()]),
    ok.

%% 钓鱼图鉴升级日志
log_fish_illustrated_lv(RoleId, IlluId, OldLv, NewLv, Cost) ->
    mod_log:add_log(log_fish_illustrated_lv, [RoleId, IlluId, OldLv, NewLv, util:term_to_bitstring(Cost), utime:unixtime()]),
    ok.

log_kf_cloud_buy_purchase(Type, SubType, ServerNum, RoleId, RoleName, ProductId, ProductName, BuyNum, BuyReward) ->
    mod_log:add_log(log_kf_cloud_buy_purchase, [Type, SubType, ServerNum, RoleId, RoleName, ProductId, ProductName, BuyNum, util:term_to_string(BuyReward), utime:unixtime()]),
    ok.

log_kf_cloud_buy_draw(Type, SubType, ServerNum, RoleId, RoleName, ProductId, RewardLv, ProductName, Reward, Time) ->
    mod_log:add_log(log_kf_cloud_buy_draw, [Type, SubType, ServerNum, RoleId, RoleName, ProductId, RewardLv, ProductName, util:term_to_string(Reward), Time]),
    ok.

%% 生活技能烹饪/打造
log_live_skill_handle(RoleId, SkillType, Lv, AddExp, NewLv, CostLive, Cost, Reward) ->
    mod_log:add_log(log_live_skill_handle, [RoleId, SkillType, Lv, AddExp, NewLv, CostLive, util:term_to_string(Cost), util:term_to_string(Reward), utime:unixtime()]),
    ok.

%% 活力变化
log_power_live(RoleId, Module, Type, OldLive, ChangeLive, NewLive) ->
    mod_log:add_log(log_power_live, [RoleId, Module, Type, OldLive, ChangeLive, NewLive, utime:unixtime()]),
    ok.

%% 砸蛋领取奖励日志
log_receive_smashed_egg_reward(RoleId, SubType, RewardList) ->
    mod_log:add_log(log_receive_smashed_egg_reward, [RoleId, SubType, util:term_to_bitstring(RewardList), utime:unixtime()]),
    ok.

%% 装备吞噬日志
log_devour(RoleId, Name, AddExp, NewLv, NowExp) ->
    mod_log:add_log(log_devour, [RoleId, Name, AddExp, NewLv, NowExp, utime:unixtime()]),
    ok.

%% 累积在线奖励
log_online_gift(RoleId, RoleLv, SubType, OnlineTime, GradeId, RewardList, RewardMultiple, AchieveTime) ->
    mod_log:add_log(log_online_gift, [RoleId, RoleLv, SubType, OnlineTime, GradeId, util:term_to_bitstring(RewardList), RewardMultiple, AchieveTime, utime:unixtime()]),
    ok.

%% 海滩消费日志
log_charm_beach(RoleServerId, RoleId, Type, CostList, Num, OtherServerId, OtherId, OtherName, OldCharmValue, NewCharmValue) ->
    mod_log:add_log(log_charm_beach, [RoleServerId, RoleId, Type, util:term_to_bitstring(CostList), Num, OtherServerId, OtherId, OtherName, OldCharmValue, NewCharmValue, utime:unixtime()]),
    ok.

%% 活动积分日志
log_custom_act_hi_point(RoleId, OldScore, AddScore, NewScore, ModuleName) ->
    mod_log:add_log(log_custom_act_hi_point, [RoleId, OldScore, AddScore, NewScore, ModuleName, utime:unixtime()]),
    ok.

%% 限时目标任务完成日志
log_limit_goal_task(RoleId, Lv, Vip, GoalId, TaskId, Condition) ->
    mod_log:add_log(log_limit_goal_task, [RoleId, Lv, Vip, GoalId, TaskId, util:term_to_bitstring(Condition), utime:unixtime()]),
    ok.

%% 限时目标任务奖励领取日志
log_limit_goal_reward(RoleId, Lv, Vip, GoalId, TaskId, Reward) ->
    mod_log:add_log(log_limit_goal_reward, [RoleId, Lv, Vip, GoalId, TaskId, util:term_to_bitstring(Reward), utime:unixtime()]),
    ok.

%% 删测回归返利日志
log_come_back(Account, Source, PlayerId, NickName, Lv, ServerId, ServerNum, OldGold, ReturnList) ->
    mod_log:add_log(log_come_back, [Account, Source, PlayerId, NickName, Lv, ServerId, ServerNum, OldGold, util:term_to_bitstring(ReturnList), utime:unixtime()]),
    ok.

%% 祈愿抽奖日志
log_supplication_reward(RoleId, Count, RewardLv, Cost, Reward, RewardId) ->
    mod_log:add_log(log_supplication_reward, [RoleId, Count, RewardLv, util:term_to_bitstring(Cost), util:term_to_bitstring(Reward), RewardId, utime:unixtime()]),
    ok.

%% 祈愿任务完成日志
log_supplication_task_finish(RoleId, TaskId, Condition) ->
    mod_log:add_log(log_supplication_task_finish, [RoleId, TaskId, util:term_to_bitstring(Condition), utime:unixtime()]),
    ok.

%% 祈愿任务奖励领取日志
log_supplication_task_reward(RoleId, TaskId, RewardId, Reward) ->
    mod_log:add_log(log_supplication_task_reward, [RoleId, TaskId, RewardId, util:term_to_bitstring(Reward), utime:unixtime()]),
    ok.

%% 快速购买日志
log_quick_buy(RoleId, BeforeGold, BeforeBGold, BeforeCoin, AfterGold, AfterBGold, AfterCoin, GoodsList) ->
    mod_log:add_log(log_quick_buy, [RoleId, BeforeGold, BeforeBGold, BeforeCoin, AfterGold, AfterBGold, AfterCoin, util:term_to_bitstring(GoodsList), utime:unixtime()]),
    ok.

%% 充值消费榜奖励日志
log_recharge_consume_rank_act(RoleId, RankType, SubType, Rank, Value, Reward) ->
    mod_log:add_log(log_recharge_consume_rank_act, [RoleId, RankType, SubType, Rank, Value, util:term_to_bitstring(Reward), utime:unixtime()]),
    ok.

%% 秘籍使用日志
log_gm_use(RoleId, Lv, Scene, FunDesc, FunData) ->
    mod_log:add_log(log_gm_use, [RoleId, Lv, Scene, util:make_sure_binary(FunDesc), util:make_sure_binary(FunData), utime:unixtime()]),
    ok.

%% 超级扭蛋奖励日志
log_capsule_toys(RoleId, Type, SubType, Wlv, DrawType, RewardList, Cost) ->
    mod_log:add_log(log_capsule_toys, [RoleId, Type, SubType, Wlv, DrawType, util:term_to_bitstring(RewardList), util:term_to_bitstring(Cost), utime:unixtime()]),
    ok.

%% 欢乐许愿日志
log_joy_wish(RoleId, Type, SubType, Wlv, WishType, RewardList, Cost) ->
    mod_log:add_log(log_joy_wish, [RoleId, Type, SubType, Wlv, WishType, util:term_to_bitstring(RewardList), util:term_to_bitstring(Cost), utime:unixtime()]),
    ok.

%% 战力构成日志
log_combat_uplv(LogList) ->
    case LogList =/= [] of
        true -> mod_log:add_log(log_combat_uplv, LogList);
        _ -> ok
    end.

%% 鲜花日志
log_flower(RoleId, ReceiverId, GoodsId, OldFame, NewFame, PreCharm, NewCharm) ->
    mod_log:add_log(log_flower, [RoleId, ReceiverId, GoodsId, OldFame, NewFame, PreCharm, NewCharm, utime:unixtime()]),
    ok.

%% 幸运翻牌抽奖日志
log_lucky_flop_draw(RoleId, Subtype, Cost, Reward, NowTimes, Turn, TotalTimes) ->
    mod_log:add_log(log_lucky_flop_draw, [RoleId, Subtype, util:term_to_bitstring(Cost), util:term_to_bitstring(Reward), NowTimes, Turn, TotalTimes, utime:unixtime()]),
    ok.

%% 幸运翻牌累计奖励日志
log_lucky_flop_receive(RoleId, Subtype, Reward, Times) ->
    mod_log:add_log(log_lucky_flop_receive, [RoleId, Subtype, util:term_to_bitstring(Reward), Times, utime:unixtime()]),
    ok.

%% 幸运翻牌重置日志
log_lucky_flop_reset(RoleId, Type, CostList, Turn) ->
    mod_log:add_log(log_lucky_flop_reset, [RoleId, Type, util:term_to_bitstring(CostList), Turn, utime:unixtime()]),
    ok.

%% 通用战力日志
log_normal_combat_power(RoleId, Name, Module, Type, OldPower, NewPower, PowerChange, Remark) ->
    mod_log:add_log(log_normal_combat_power, [RoleId, Name, Module, Type, OldPower, NewPower, PowerChange, Remark, utime:unixtime()]),
    ok.

%% 境界学位晋升日志
log_degree_upgrade(RoleId, DegreeId, Exp, DunState) ->
    mod_log:add_log(log_degree_upgrade, [RoleId, DegreeId, Exp,  util:term_to_bitstring(DunState), utime:unixtime()]),
    ok.

%% 学位日常功课奖励领取日志
log_receive_degree_reward(RoleId, ClassId, TaskType, TaskId, OldExp, NewExp) ->
    mod_log:add_log(log_receive_degree_reward, [RoleId, ClassId, TaskType, TaskId, OldExp, NewExp, utime:unixtime()]),
    ok.

%% 交易市场日志
log_market_operation(LogData) ->
    mod_log:add_log(log_market_operation, LogData),
    ok.

log_market_race(LogData) ->
    mod_log:add_log(log_market_race, LogData),
    ok.

%% 孩子同心值日志
log_child_link_heart(RoleId, Type, TaskId, Cost, GetLinkHeart, OldLinkHeart, NewLinkHeart) ->
    mod_log:add_log(log_child_link_heart, [RoleId, Type, TaskId, util:term_to_string(Cost), GetLinkHeart, OldLinkHeart, NewLinkHeart, utime:unixtime()]),
    ok.

%% 孩子培养日志
log_child_upgrade(RoleId, OldStage, OldStar, NewStage, NewStar, Cost) ->
    mod_log:add_log(log_child_upgrade, [RoleId, OldStage, OldStar, NewStage, NewStar, util:term_to_string(Cost), utime:unixtime()]),
    ok.

%% 孩子时装载具日志
log_child_item(RoleId, Type, ItemType, ItemId, Cost, OldStage, NewStage) ->
    mod_log:add_log(log_child_item, [RoleId, Type, ItemType, ItemId, util:term_to_string(Cost), OldStage, NewStage, utime:unixtime()]),
    ok.

%% 孩子技能
log_child_skill(RoleId, SkillId, OldSkillLv, NewSkillLv, Cost) ->
    mod_log:add_log(log_child_skill, [RoleId, SkillId, OldSkillLv, NewSkillLv, util:term_to_string(Cost), utime:unixtime()]),
    ok.

%% 孩子玩具
log_child_toy(RoleId, SuitType, ToyId, Cost) ->
    mod_log:add_log(log_child_toy, [RoleId, SuitType, ToyId, util:term_to_string(Cost), utime:unixtime()]),
    ok.

%% 孩子玩具盒
log_child_toy_box(RoleId, Type, OldBoxLv, NewBoxLv, ExpBef, ExpAft, ToyCost) ->
    mod_log:add_log(log_child_toy_box, [RoleId, Type, OldBoxLv, NewBoxLv, ExpBef, ExpAft, util:term_to_string(ToyCost), utime:unixtime()]),
    ok.

%% 孩子点赞榜
log_child_rank(RoleId, ChildName, Rank, Vote) ->
    mod_log:add_log(log_child_rank, [RoleId, ChildName, Rank, Vote, utime:unixtime()]),
    ok.

%% 宠物养成
log_pet_grow(RoleId, PetId, OldStar, OldLv, OldExp, Type, NewStar, NewLv, NewExp, Cost) ->
    CostStr = util:term_to_string(Cost),
    mod_log:add_log(log_pet_grow, [RoleId, PetId, OldStar, OldLv, OldExp, Type, NewStar, NewLv, NewExp, CostStr, utime:unixtime()]),
    ok.

%% 宠物宝石
log_pet_jewel(RoleId, PetId, Pos, OldDiamondId, NewDiamondId) ->
    mod_log:add_log(log_pet_jewel, [RoleId, PetId, Pos, OldDiamondId, NewDiamondId, utime:unixtime()]),
    ok.

%% 功能预告
log_advance_produce(RoleId, RoleLv, FuncId, FunName, ConDesc, Reward, OpenDay) ->
    RewardStr = util:term_to_string(Reward),
    mod_log:add_log(log_advance_produce, [RoleId, RoleLv, FuncId, FunName, ConDesc, RewardStr, OpenDay, utime:unixtime()]),
    ok.

%% 产生协助单
log_ask_guild_support(AskId, GuildId, SupportId, SupportCfgId, Content) ->
    mod_log:add_log(log_ask_guild_support, [AskId, GuildId, SupportId, SupportCfgId, util:term_to_string(Content), utime:unixtime()]),
    ok.

%% 协助单结算
log_guild_support_reward(SupporterId, GuildId, SupportId, CfgId, Type) ->
    mod_log:add_log(log_guild_support_reward, [SupporterId, GuildId, SupportId, CfgId, Type, utime:unixtime()]),
    ok.

%% vip状态变更记录
log_vip_status(RoleId, VipType, TrialLv, Lv, GoodsId, LogType, EndTime, NowTime) ->
    mod_log:add_log(log_vip_status, [RoleId, VipType, TrialLv, Lv, GoodsId, LogType, EndTime, NowTime]),
    ok.

%% vip经验增加
log_vip_upgrade(RoleId, VipType, VipLv, VipExp, GoldAdd, NowTime) ->
    mod_log:add_log(log_vip_upgrade, [RoleId, VipType, VipLv, VipExp, GoldAdd, NowTime]),
    ok.

%% 贵族状态变更
log_sup_vip_status(RoleId, SupVipType, LogType, NowTime) ->
    mod_log:add_log(log_sup_vip_status, [RoleId, SupVipType, LogType, NowTime]),
    ok.

%% 贵族期间充值记录
log_trial_sup_vip_charge(RoleId, GoldAdd, TotalGold, Time) ->
    mod_log:add_log(log_trial_sup_vip_charge, [RoleId, GoldAdd, TotalGold, Time]),
    ok.

%% 贵族兑换记录
log_sup_vip_exchange(RoleId, RoleName, VipLv, OpType, Cost, RewardList, OldTime, NewTime, OldGold, NewGold) ->
    mod_log:add_log(log_sup_vip_exchange, [RoleId, RoleName, VipLv, OpType, util:term_to_bitstring(Cost), util:term_to_bitstring(RewardList), OldTime, NewTime, OldGold, NewGold, utime:unixtime()]),
    ok.

%% 器灵寻宝
log_marble(RoleId, RoleName, QualId, Rewards, EnergyPoint, NewEnergyPro, Now) ->
    mod_log:add_log(log_marble, [RoleId, RoleName, QualId, util:term_to_bitstring(Rewards), EnergyPoint, NewEnergyPro, Now]),
    ok.

%% 日志-装备强化
log_equipment_strength(RoleId, Name, Series, EquipType, GoodsId, GoodsTypeId, Result, LvBefore, LvAfter, Ratio, Cost) ->
    mod_log:add_log(log_equipment_strength, [RoleId, Name, Series, EquipType, GoodsId, GoodsTypeId, Result, LvBefore, LvAfter, Ratio, util:term_to_string(Cost), utime:unixtime()]).

%% 日志-装备进化
log_equipment_great(RoleId, Name, Series, EquipType, GoodsId, GoodsTypeId, Result, GreatBefore, GreatAfter, Ratio, Cost) ->
    mod_log:add_log(log_equipment_great, [RoleId, Name, Series, EquipType, GoodsId, GoodsTypeId, Result, util:term_to_string(GreatBefore), util:term_to_string(GreatAfter), Ratio, util:term_to_string(Cost), utime:unixtime()]).

%% 日志-装备器灵
log_equipment_empower(RoleId, Name, Series, EquipType, LvBefore, LvAfter, Cost) ->
    mod_log:add_log(log_equipment_empower, [RoleId, Name, Series, EquipType, LvBefore, LvAfter, util:term_to_string(Cost), utime:unixtime()]).

%% 日志-装备继承
log_equipment_inherit(RoleId, Name, Type, GoodsId, GoodsTypeId, CostEquipment, AttrAfter, AttrBefore) ->
    mod_log:add_log(log_equipment_inherit, [RoleId, Name, Type, GoodsId, GoodsTypeId, CostEquipment, util:term_to_string(AttrAfter), util:term_to_string(AttrBefore), utime:unixtime()]).

%% 日志-装备宝石镶卸
log_equipment_gems(RoleId, Name, Type, Series, EquipType, GoodsBefore, GoodsAfter) ->
    mod_log:add_log(log_equipment_gems, [RoleId, Name, Type, Series, EquipType, GoodsBefore, GoodsAfter, utime:unixtime()]).

%% 日志-灵装升级
log_nucleon_equip_upgrade(RoleId,Name, Pos, LvBef,ExpBef, LvAft, ExpAft, Cost) ->
    mod_log:add_log(log_nucleon_equip_upgrade, [RoleId,Name, Pos, LvBef,ExpBef, LvAft, ExpAft,util:term_to_string(Cost), utime:unixtime()]).


%% 日志-灵装洗练
log_nucleon_equip_recast(RoleId,Name,MainID,MGoodsID,MAttrBef,MAttrAft,SubID,SGoodsID,SAttr,Cost) ->
    mod_log:add_log(log_nucleon_equip_recast, [RoleId,Name,MainID,MGoodsID,util:term_to_string(MAttrBef),util:term_to_string(MAttrAft),SubID,SGoodsID,util:term_to_string(SAttr),util:term_to_string(Cost), utime:unixtime()]).

%%灵装觉醒
log_nucleon_section(RoleId,Name,Pos,Lv,Cost)->
    mod_log:add_log(log_nucleon_section, [RoleId,Name,Pos,Lv,util:term_to_string(Cost), utime:unixtime()]).

%%灵装抽奖
log_nucleon_hunt(RoleId,Name,OpTy,Num,IsFree,Awards,Cost)->
    mod_log:add_log(log_nucleon_hunt, [RoleId,Name,OpTy,Num,IsFree,util:term_to_string(Awards),util:term_to_string(Cost), utime:unixtime()]).

%%灵能分解
log_nucleon_resolve(RoleID,Name,Gain,Cost)->
    mod_log:add_log(log_nucleon_resolve, [RoleID,Name,util:term_to_string(Gain),util:term_to_string(Cost), utime:unixtime()]).

%%格子日志
log_lattice(RoleId, Circle, PreStep, Points, Cost, Reward) ->
    CostBin = util:term_to_bitstring(Cost),
    RewardBin = util:term_to_bitstring(Reward),
    mod_log:add_log(log_lattice, [RoleId, Circle, PreStep, Points, CostBin, RewardBin, utime:unixtime()]),
    ok.

%% 跨服竞榜活动-玩家抽奖记录
log_race_rank_draw(LogData) ->
    mod_log:add_log(log_race_rank_draw, LogData).

log_race_rank_times_award(RoleId,RName,ActId,AwardId,Awards0,NeedS,CurScore,Vip)->
    Awards = util:term_to_bitstring(Awards0),
    mod_log:add_log(log_race_rank_times_award, [RoleId,RName,ActId,AwardId,Awards,NeedS,CurScore,Vip, utime:unixtime()]),
    ok.

log_race_rank_wish(LogData)->
    mod_log:add_log(log_race_rank_wish, LogData).

%% 日志-社团战本服-个人排名
log_guild_war_role_rank(LogData) ->
    mod_log:add_log(log_guild_war_role_rank, LogData).

%% 日志-社团战本服-社团排名
log_guild_war_guild_rank(LogData) ->
    mod_log:add_log(log_guild_war_guild_rank, LogData).

%% 唤神操作日志
log_god_operate([RoleId, RoleName, GodId, OpType, OldStar, Star, OldLv, Lv, Exp, Skill, Cost])->
    mod_log:add_log(log_god_operate, [RoleId, RoleName, GodId, OpType, OldStar, Star, OldLv, Lv, Exp, Skill, Cost, utime:unixtime()]),
    ok.

%% 唤神装备强化
log_god_equip_upgrade(Info) ->
    mod_log:add_log(log_god_equip_upgrade, Info),
    ok.

%% 唤神召唤操作日志
log_god_lottery(Info) ->
    mod_log:add_log(log_god_lottery, Info),
    ok.

%%进阶升级日志
log_foster_upgrade(LogData)->
    mod_log:add_log(log_foster_upgrade, LogData),
    ok.

%%进阶核心日志
log_foster_core_upgrade(LogData)->
    mod_log:add_log(log_foster_core_upgrade, LogData),
    ok.

%%进阶技能日志
log_foster_skill_upgrade(LogData)->
    mod_log:add_log(log_foster_skill_upgrade, LogData),
    ok.

%%进阶装备日志
log_foster_equip(LogData)->
    mod_log:add_log(log_foster_equip, LogData),
    ok.

%%进阶装备升级日志
log_foster_equip_lv(LogData)->
    mod_log:add_log(log_foster_equip_lv, LogData),
    ok.

%%进阶皮肤升级日志
log_foster_skin_upgrade(LogData)->
    mod_log:add_log(log_foster_skin_upgrade, LogData),
    ok.

%% 离线托管日志
log_offline_hosting(LogData)->
    mod_log:add_log(log_offline_hosting, LogData),
    ok.

%%本地结算日志
log_local_vie_rank(LogData)->
    mod_log:add_log(log_local_vie_rank, LogData),
    ok.

%%积分获得日志
log_vie_score(SubType,RoleID,Name,AddScore,NScore)->
    mod_log:add_log(log_vie_score,[SubType,RoleID,Name,AddScore,NScore,utime:unixtime()]),
    ok.

%% 冒险征程抽奖日志
log_adventure_lottery(Info) ->
    mod_log:add_log(log_adventure_lottery, Info),
    ok.

%% 黑白棋操作抽奖日志
log_reversi_lottery(Info) ->
    mod_log:add_log(log_reversi_lottery, Info),
    ok.

%% 福利卡领奖日志
log_recharge_welfare(Info) ->
    mod_log:add_log(log_recharge_welfare, Info),
    ok.

%% 充值商品购买日志
log_charge_goods(Info) ->
    mod_log:add_log(log_charge_goods, Info),
    ok.

%% 精英考核任务日志
log_elite_assess_task(RoleId, RoleLv, Category, SubCategory, TaskId, TaskDesc) ->
    mod_log:add_log(log_elite_assess_task, [RoleId, RoleLv, Category, SubCategory, TaskId, TaskDesc, utime:unixtime()]),
    ok.

%% 精英考核奖励日志
log_elite_assess_award(RoleId, RoleLv, Category, SubCategory, Type, RewardId, RewardDesc, Reward) ->
    RewardStr = util:term_to_string(Reward),
    mod_log:add_log(log_elite_assess_award, [RoleId, RoleLv, Category, SubCategory, Type, RewardId, RewardDesc, RewardStr, utime:unixtime()]),
    ok.

%% 扭蛋宝库抽奖日志
log_capsule_egg_draw(RoleId, PoolType, Type, Reward, ColorMax, Absolute, Cost) ->
    RewardStr = util:term_to_string(Reward),
    CostStr = util:term_to_string(Cost),
    mod_log:add_log(log_capsule_egg_draw, [RoleId, PoolType, Type, RewardStr, ColorMax, Absolute, CostStr, utime:unixtime()]),
    ok.

%% 扭蛋宝库抽奖次数奖励日志
log_capsule_egg_award_times(RoleId, RoleName, PoolType, Times, TimesNeed, Reward) ->
    RewardStr = util:term_to_string(Reward),
    mod_log:add_log(log_capsule_egg_award_times, [RoleId, RoleName, PoolType, Times, TimesNeed, RewardStr, utime:unixtime()]),
    ok.

%% 废土战场(饥饿游戏)参与日志
log_wasteland_war(ZoneId, ServerId, ServerNum, KfGrade, RoleId, Type, Round, Rank, Score) ->
    mod_log:add_log(log_wasteland_war, [ZoneId, ServerId, ServerNum, KfGrade, RoleId, Type, Round, Rank, Score, utime:unixtime()]),
    ok.

%% 宠物副本排行榜日志
log_dun_pet_rank_reward(RoleId, Score, Rank) ->
    mod_log:add_log(log_dun_pet_rank_reward, [RoleId, Score, Rank, utime:unixtime()]),
    ok.

%% 舞池派对排行榜
log_beach_rank(Room, Line, ServerId, ServerNum, KfGrade, RoleId, VipLv, Power, Votes, Rank, Reward) ->
    RewardStr = util:term_to_string(Reward),
    mod_log:add_log(log_beach_rank, [Room, Line, ServerId, ServerNum, KfGrade, RoleId, VipLv, Power, Votes, Rank, RewardStr, utime:unixtime()]),
    ok.

%% 舞池派对投票
log_beach_vote(Room, Line, ServerId, ServerNum, RoleId, DancerId, DancerName, LeftFreeVotes, ExpReward) ->
    RewardStr = util:term_to_string(ExpReward),
    mod_log:add_log(log_beach_vote, [Room, Line, ServerId, ServerNum, RoleId, DancerId, DancerName, LeftFreeVotes, RewardStr, utime:unixtime()]),
    ok.

%% 社团竞速社团排名
log_guild_race_rank_guild(GuildId, GuildName, Power, GuildRank, OpenDay) ->
    mod_log:add_log(log_guild_race_rank_guild, [GuildId, GuildName, Power, GuildRank, OpenDay, utime:unixtime()]),
    ok.

%% 社团竞速个人排名
log_guild_race_rank_role(RoleId, GuildId, GuildRank, Power, RoleRank, OpenDay) ->
    mod_log:add_log(log_guild_race_rank_role, [RoleId, GuildId, GuildRank, Power, RoleRank, OpenDay, utime:unixtime()]),
    ok.

%% 阶段奖励日志
log_phase_exchange(SubType, RoleId, RoleName, RoleLv, NeedLv, StoreId, GradeId, Type, RewardList, GoodCost, CostNum) ->
    NeedLvStr = util:term_to_string(NeedLv),
    RewardListStr = util:term_to_string(RewardList),
    mod_log:add_log(log_phase_exchange, [SubType, RoleId, RoleName, RoleLv, NeedLvStr,
        StoreId, GradeId, Type, RewardListStr, GoodCost, CostNum, utime:unixtime()
    ]),
    ok.

%%灵能升级日志
log_nucleon_lv(RoleID,RName,OldLv,NewLv)->
    mod_log:add_log(log_nucleon_lv, [RoleID,RName,OldLv,NewLv,utime:unixtime()]),
    ok.

log_nucleon_equip(RoleID,RName,OpTy,Pos,OGoods,IGoods)->
    mod_log:add_log(log_nucleon_equip, [RoleID,RName,OpTy,Pos,OGoods,IGoods,utime:unixtime()]),
    ok.

log_nucleon_exchange(RoleID,RName,Gain0,Cost0)->
    Gain = util:term_to_string(Gain0),
    Cost = util:term_to_string(Cost0),
    mod_log:add_log(log_nucleon_exchange, [RoleID,RName,Gain,Cost,utime:unixtime()]),
    ok.

log_nucleon_equip_evo(RoleID,Name,ItemID,Next,EquipCost0,Uid)->
    EquipCost = util:term_to_string(EquipCost0),
    mod_log:add_log(log_nucleon_equip_evo, [RoleID,Name,ItemID,Next,EquipCost,Uid,utime:unixtime()]),
    ok.

%% 排行榜日志
log_rank(Info) ->
    mod_log:add_log(log_rank, Info),
    ok.

%% 跨服排行榜
log_cross_rank(Info) ->
    mod_log:add_log(log_cross_rank, Info),
    ok.

%% 放置经验日志
log_onhook_result(Info) ->
    mod_log:add_log(log_onhook_result, Info),
    ok.

log_galaxy_pos(RoleId,RName,Type,Pos,Cost0)->
    Cost = util:term_to_string(Cost0),
    mod_log:add_log(log_galaxy_pos, [RoleId,RName,Type,Pos,Cost,utime:unixtime()]),
    ok.

log_galaxy_equip(RoleID,RName,Type,Pos,OGoods,IGoods)->
    mod_log:add_log(log_galaxy_equip, [RoleID,RName,Type,Pos,OGoods,IGoods,utime:unixtime()]),
    ok.

log_galaxy_change(RoleID,RName,OpTy,Item,Lev,NewLev,Cost0,Gains0)->
    Cost = util:term_to_string(Cost0),
    Gains = util:term_to_string(Gains0),
    mod_log:add_log(log_galaxy_change, [RoleID,RName,OpTy,Item,Lev,NewLev,Cost,Gains,utime:unixtime()]),
    ok.

log_galaxy_skin(RoleID,RName,SkinId,Cost0,OStar,NStar)->
    Cost = util:term_to_string(Cost0),
    mod_log:add_log(log_galaxy_skin, [RoleID,RName,SkinId,Cost,OStar,NStar,utime:unixtime()]),
    ok.

log_visus_upgrade(RoleID,RName,OpTy,Vid,CLv,NLv,Cost0,Condition0,Desc0)->
    Cost = util:term_to_string(Cost0),
    Condition = util:term_to_string(Condition0),
    Desc = util:term_to_string(Desc0),
    mod_log:add_log(log_visus_upgrade, [RoleID,RName,OpTy,Vid,CLv,NLv,Cost,Condition,Desc,utime:unixtime()]),
    ok.

log_uranium_upgrade(RoleID,Name,Grade,Lv,NGrade,NLv)->
    mod_log:add_log(log_uranium_upgrade, [RoleID,Name,Grade,Lv,NGrade,NLv,utime:unixtime()]),
    ok.

%% 快速放置经验日志
log_onhook_fast(Info) ->
    mod_log:add_log(log_onhook_fast, Info),
    ok.

%% 经验副本日志
log_exp_dun(Info) ->
    mod_log:add_log(log_exp_dun, Info),
    ok.

%% 跨服团战社团排名日志
log_camp_war_rank_guild(Info) ->
    mod_log:add_log(log_camp_war_rank_guild, Info),
    ok.

%% 跨服团战个人排名日志
log_camp_war_rank_role(Info) ->
    mod_log:add_log(log_camp_war_rank_role, Info),
    ok.

%% 社团采集日志
log_guild_collect(Info) ->
    mod_log:add_log(log_guild_collect, Info),
    ok.
%% 羁绊-关系 操作类型##（1.建立羁绊，2强制解除，3协议解除）
log_mate_rela(FromRole, MateName, RoleId, Name, Type, Cost) ->
    mod_log:add_log(log_mate_rela, [FromRole, MateName, RoleId, Name, Type, Cost, utime:unixtime()]),
    ok.

%% 羁绊-纪念日奖励
log_mate_anniversary(RoleId, Name, TargetRole, TargetName, Award, Day, DiffDay, Now) ->
    mod_log:add_log(log_mate_anniversary, [RoleId, Name, TargetRole, TargetName, Award, Day, DiffDay, Now]),
    ok.

%% 羁绊-小船升级
log_mate_boat(RoleId, Name, Stage, Star, Exp, Cost, Time) ->
    mod_log:add_log(log_mate_boat, [RoleId, Name, Stage, Star, Exp, Cost, Time]),
    ok.

%% 合成日志
log_compose_evolution(Info) ->
    mod_log:add_log(log_compose_evolution, Info),
    ok.

%% 签到奖励日志
log_sign_in(Info) ->
    mod_log:add_log(log_sign_in, Info),
    ok.

%% 冲级礼包日志
log_level_award(Info) ->
    mod_log:add_log(log_level_award, Info),
    ok.

%% 战魂-上阵日志
log_war_soul_equip(Info) ->
    mod_log:add_log(log_war_soul_equip, Info),
    ok.

%% 战魂-强化日志
log_war_soul_strength(Info) ->
    mod_log:add_log(log_war_soul_strength, Info),
    ok.

%% 战魂-分解日志
log_war_soul_del(Info) ->
    mod_log:add_log(log_war_soul_del, Info),
    ok.

%% 战魂-进化日志
log_war_soul_evolution(Info) ->
    mod_log:add_log(log_war_soul_evolution, Info),
    ok.

%% 战魂-图鉴日志
log_war_soul_handbook(Info) ->
    mod_log:add_log(log_war_soul_handbook, Info),
    ok.

%% 竞技排位赛日志
log_arena(Info) ->
    mod_log:add_log(log_arena, Info),
    ok.

%% 竞技场赛季结算日志
log_arena_season_award(LogData) ->
    mod_log:add_log(log_arena_season_award, LogData),
    ok.

%% 竞技购买次数日志
log_arena_buy_times(RoleId, PreGold, PreBGold, PreCoin, BuyTimes, AfterGold, AfterBGold, AfterCoin) ->
    mod_log:add_log(log_arena_buy_times, [RoleId, PreGold, PreBGold, PreCoin, BuyTimes, AfterGold, AfterBGold, AfterCoin, utime:unixtime()]),
    ok.

%% 竞技联赛每日奖励 奖励类型##（0-每日奖励；1-每日首胜；2-每日五战）
log_arena_daily_reward(LogData) ->
    mod_log:add_log(log_arena_daily_reward, LogData),
    ok.

%% 狂战领域-排名奖励（本服）
log_madness_land_role_reward(LogData) ->
    mod_log:add_log(log_madness_land_role_reward, LogData),
    ok.

%% 狂战领域-排名奖励（跨服）
log_madness_land_role_reward_kf(LogData) ->
    mod_log:add_log(log_madness_land_role_reward_kf, LogData),
    ok.

%% 靓丽大赛-主动报名日志
log_beauty_contest_sign(LogData) ->
    mod_log:add_log(log_beauty_contest_sign, LogData),
    ok.

%% 靓丽大赛-投票日志
log_beauty_contest_vote(LogData) ->
    mod_log:add_log(log_beauty_contest_vote, LogData),
    ok.

%% 靓丽大赛-排名日志
log_beauty_contest_rank(LogData) ->
    mod_log:add_log(log_beauty_contest_rank, LogData),
    ok.

%% 护送结果 end_type 1完美|2损坏|3超时|4取消
log_convoy_result(LogData) ->
    mod_log:add_log(log_convoy_result, LogData),
    ok.

%% 护送刷新表
log_convoy_refresh(LogData) ->
    mod_log:add_log(log_convoy_refresh, LogData),
    ok.

%% 护送拦截  类型(1打劫|2被劫)
log_convoy_take(LogData) ->
    mod_log:add_log(log_convoy_take, LogData),
    ok.

%% 托管值结算日志
log_offline_hosting_change(LogData) ->
    mod_log:add_log(log_offline_hosting_change, LogData),
    ok.

%% 玩家每日属性记录
log_player_attr(LogData) ->
    mod_log:add_log(log_player_attr, LogData),
    ok.
log_player_daily(LogData) ->
    mod_log:add_log(log_player_daily, LogData),
    ok.
%% 投资领奖日志
log_investment(LogData) ->
    mod_log:add_log(log_investment, LogData),
    ok.

%% 定制充值消费活动日志
log_recharge_consume_act(LogData) ->
    mod_log:add_log(log_recharge_consume_act, LogData),
    ok.

log_void_fam(RoleId, RName, Zone, Stage, Type, Floor, Score)->
    mod_log:add_log(log_void_fam, [RoleId, RName, Zone, Stage, Type, Floor, Score,utime:unixtime()]),
    ok.

log_cross_guild_war(Zone,RoleId,RName,GuildId,Stage,Power,Filed)->
    mod_log:add_log(log_cross_guild_war, [Zone,RoleId,RName,GuildId,Stage,Power,Filed,utime:unixtime()]),
    ok.

log_cross_guild_war_conquer(Zone,SerId,SerNum,RoleId,RName,GuildId,IsLord,CityId)->
    mod_log:add_log(log_cross_guild_war_conquer, [Zone,SerId,SerNum,RoleId,RName,GuildId,IsLord,CityId,utime:unixtime()]),
    ok.

log_cross_guild_war_support(Zone,SerId,SerNum,RoleId,Name,GuildId,GName,Cost0,RTimes)->
    Cost = util:term_to_string(Cost0),
    mod_log:add_log(log_cross_guild_war_support, [Zone,SerId,SerNum,RoleId,Name,GuildId,GName,Cost,RTimes,utime:unixtime()]),
    ok.

log_foster_loop(RoleID,RName,SubType,AwardId,Cons0,CurG,CurStar,NextCons0,RewardList0)->
    Cons = util:term_to_string(Cons0),
    NextCons = util:term_to_string(NextCons0),
    RewardList = util:term_to_string(RewardList0),
    mod_log:add_log(log_foster_loop, [RoleID,RName,SubType,AwardId,Cons,CurG,CurStar,NextCons,RewardList,utime:unixtime()]),
    ok.

log_mobilize_award(RoleId,RName,SubType,OpTy,StartDay,EndDay,TaskType,TaskId,Awards0)->
    Awards = util:term_to_string(Awards0),
    mod_log:add_log(log_mobilize_award, [RoleId,RName,SubType,OpTy,StartDay,EndDay,TaskType,TaskId,Awards,utime:unixtime()]),
    ok.

%% 明日之礼购买日志
log_hope_gift_buy(RoleId, SubType, Grade, GoldCost, GoldBefore, AwardList, Level, Vip, Time) ->
    BinAwardList = util:term_to_bitstring(AwardList),
    mod_log:add_log(log_hope_gift_buy, [RoleId, SubType, Grade, GoldCost, GoldBefore, BinAwardList, Level, Vip, Time]),
    ok.

%% 明日之礼返还日志
log_hope_gift_return_batch(RoleId, SubType, ReturnInfoList, NowTime) ->
    LogArgsList = [
        [
            RoleId, SubType, GradeId,
            util:term_to_bitstring(RewardAwards),
            NowGotNum, Total - NowGotNum,
            NowTime
        ] ||
        {GradeId, RewardAwards, NowGotNum, Total} <- ReturnInfoList
    ],
    case LogArgsList of
        [_|_] -> mod_log:add_log(log_hope_gift_return, LogArgsList);
        _ -> ignore
    end,
    ok.

%% 明日之礼抽奖日志
log_hope_gift_draw(RoleId, SubType, AwardList, Round, CostNum, ItemBefore, Time) ->
    BinAwardList = util:term_to_bitstring(AwardList),
    mod_log:add_log(log_hope_gift_draw, [RoleId, SubType, BinAwardList, Round, CostNum, ItemBefore, Time]),
    ok.

%% 团购购买日志
log_group_buy(RoleId, SubType, GradeId, GoldType, GoldCost, GoldBef, BgoldBef, AwardList,
    Discount, BuyerCount, FixBuyerCount, Stage, StageNoFix, StageTotal, Vip, Time) ->
    BinAwardList = util:term_to_bitstring(AwardList),
    mod_log:add_log(
        log_group_buy,
        [
            RoleId, SubType, GradeId, GoldType, GoldCost, GoldBef, BgoldBef, BinAwardList,
            Discount, BuyerCount, FixBuyerCount, Stage, StageNoFix, StageTotal, Vip, Time
        ]
    ),
    ok.

%% 团购返还日志
log_group_buy_return(RoleId, SubType, GradeId, GoldType, GoldNum, Discount, IsMail, Time) ->
    mod_log:add_log(
        log_group_buy_return,
        [RoleId, SubType, GradeId, GoldType, GoldNum, Discount, IsMail, Time]
    ),
    ok.

%% 弹珠累充累消活动档次奖励日志
log_pellet_daily(RoleId, SubType, GradeId, CondType, GoldNeed, GoldTotal, IsMail, AwardList, Vip, Time) ->
    BinAwardList = util:term_to_bitstring(AwardList),
    mod_log:add_log(
        log_pellet_daily,
        [RoleId, SubType, GradeId, CondType, GoldNeed, GoldTotal, IsMail, BinAwardList, Vip, Time]
    ),
    ok.

%% 累充消费弹珠抽奖奖励日志
log_pellet_draw(RoleId, Round, AwardType, AwardId, AwardList, Times, Vip, Vaild, DrawGrade, DrawTime, AwardTime) ->
    BinAwardList = util:term_to_bitstring(AwardList),
    mod_log:add_log(
        log_pellet_draw,
        [RoleId, Round, AwardType, AwardId, BinAwardList, Times, Vip, Vaild, DrawGrade, DrawTime, AwardTime]
    ),
    ok.

%% 七日目标日志
log_seven_days_goal(RoleId, Type, Name, Lv, Score, OpenDays, Grade, Reward)->
    BinReward = util:term_to_bitstring(Reward),
    BinGrade = util:term_to_bitstring(Grade),
    mod_log:add_log(log_seven_days_goal, [RoleId, Type, Name, Lv, Score, OpenDays, BinGrade, BinReward, utime:unixtime()]),
    ok.

log_seven_goal_task(RoleId, Name, Lv, Rfmt, Day, Task) ->
    BinRfmt = util:term_to_bitstring(Rfmt),
    BinTask = util:term_to_bitstring(Task),
    mod_log:add_log(log_seven_goal_task, [RoleId, Name, Lv, BinRfmt, Day, BinTask, utime:unixtime()]),
    ok.

%% 物品转换日志
log_goods_convert(RoleId, GoodsTypeId, Reward, Time)->
    BinReward = util:term_to_bitstring(Reward),
    mod_log:add_log(log_goods_convert, [RoleId, GoodsTypeId, BinReward, Time]),
    ok.

log_glamour_item(RoleID,Name,RunID,RName,Item,IsHit,Free)->
    mod_log:add_log(log_glamour_item, [RoleID,Name,RunID,RName,Item,IsHit,Free,utime:unixtime()]),
    ok.

log_glamour_like(RoleID,Name,Money,NewMoney,Round,Datas0)->
    Datas = util:term_to_bitstring(Datas0),
    mod_log:add_log(log_glamour_like, [RoleID,Name,Money,NewMoney,Round,Datas,utime:unixtime()]),
    ok.

log_glamour_rank(Rid,Name,Rank,Total,Rewards0)->
    Rewards = util:term_to_bitstring(Rewards0),
    mod_log:add_log(log_glamour_rank, [Rid,Name,Rank,Total,Rewards,utime:unixtime()]),
    ok.

log_guild_boss_guild(Gid,GName,GRank,GAwards0)->
    GAwards = util:term_to_bitstring(GAwards0),
    mod_log:add_log(log_guild_boss_guild, [Gid,GName,GRank,GAwards,utime:unixtime()]),
    ok.

log_guild_boss_role(Rid,Name,Gid,GName,ActTime,Rank)->
    mod_log:add_log(log_guild_boss_role, [Rid,Name,Gid,GName,ActTime,Rank,utime:unixtime()]),
    ok.

log_guild_boss_share(GuildID,GName,Len,RealRate,Cash,Money)->
    mod_log:add_log(log_guild_boss_share, [GuildID,GName,Len,RealRate,Cash,Money,utime:unixtime()]),
    ok.

%% 玩家每日属性记录
log_skill_active(LogData) ->
    mod_log:add_log(log_skill_active, LogData),
    ok.

custom_act_reward_log(NewPlayer, Player, Type, SubType, Grade, Reward)->
    custom_act_reward_log(NewPlayer, Player, Type, SubType, Grade, "0", Reward).

custom_act_reward_log(NewPlayer, Player, Type, SubType, Grade, ReMark, Reward)->
    #player_status{id = RoleId, figure = Figure, gold = Gold, bgold = BGold} = Player,
    #player_status{gold = NewGold, bgold = NewBGold} = NewPlayer,
    #figure{vip = Vip, lv = Lv} = Figure,
    WorldLv = util:get_world_lv(),
    log_custom_act_reward(RoleId, Type, SubType, Grade, WorldLv,
        Reward, ReMark, Vip, Lv, Gold, NewGold, BGold, NewBGold, utime:unixtime()
    ),
    ok.

%% 幻魔次数日志
log_boss_change([RoleId, RoleName, BossType, AfterNum, BeforNum, ChangeType, BossId, Time]) ->
    mod_log:add_log(log_boss_change, [RoleId, RoleName, BossType, AfterNum, BeforNum, ChangeType, BossId, Time]),
    ok.

%% 幻魔归属日志
log_boss_belong([RoleId, RoleName, IsCluster, SvrNum, RoleLv, BossType, BossLv, BossId, BelongRoles, FirstKill, Time]) ->
    mod_log:add_log(log_boss_belong, [RoleId, RoleName, IsCluster, SvrNum, RoleLv, BossType, BossLv, BossId, util:term_to_bitstring(BelongRoles), FirstKill, Time]),
    ok.

%% 幻魔掉落拾取日志
log_boss_drop([BossType, BossId, BelongRoleId, BelongTeamId, GoodsId, GoodsNum, IsBind, ExpireTime, HurtList, Time]) ->
    mod_log:add_log(log_boss_drop, [BossType, BossId, BelongRoleId, BelongTeamId, GoodsId, GoodsNum, IsBind, ExpireTime, HurtList, Time]),
    ok.

%% 装备考核任务
log_equipment_task(LogData) ->
    mod_log:add_log(log_equipment_task, LogData),
    ok.

%% 装备考核星级
log_equipment_star(LogData) ->
    mod_log:add_log(log_equipment_star, LogData),
    ok.

%% 装备考核任务领奖
log_equipment_task_reward(LogData) ->
    mod_log:add_log(log_equipment_task_reward, LogData),
    ok.

%% 装备收集领奖
log_equipment_collect_reward(LogData) ->
    mod_log:add_log(log_equipment_collect_reward, LogData),
    ok.

%% 跨服沙盘挑战
log_cross_point_fight(LogData) ->
    mod_log:add_log(log_cross_point_fight, LogData),
    ok.
