æååãã«ã¤ãã¦
ãã®è¨äºã¯pyspa Advent Calendarã®19æ¥ç®ã®è¨äºã¨ãã¦æ¸ããã¾ããã æ¨æ¥ã¯rokujyouhitomaã®ãã¢ã¯ã¢ãªã¦ã å§ãããã®ã§ååãããã¹ããããã¦å§ããæ¥ã¯æ¥ãã®ããã§ãããç§ããã¹ããçµãã£ããã¢ã¯ã¢ãªã¦ã ããããã¨æããã10å¹´ãããçµã£ã¦ããæ°ããã¾ãã
TL;DR
æååãã¯äººé¡ã®é²æ©ã®è¨¼ã人ã ã®å¶ã¿ã¨ä¼ã¿ã®éã«çã¾ããã°ãªããã
ã¯ããã«
ãæååããã¨ããè¨èãçã¾ããã®ã¯ãã¤ã®ãã¨ãªã®ãã¯ããããªããã ããæååãã¨ãããã®ããè¨èªã®è¡¨ç¾ã«å¿ è¦ãªæ§æè¦ç´ (é³ç´ ãªã©) ã符å·åã並ã¹ããã®ããã£ãã¨ãã«ããã®ç¬¦å·ã®ä¸¦ã³ã®è§£éãéãæã¨åãæã¨ã®éã§ç¸ç°ãªã£ãç¶æ ã§ããã¨å®ç¾©ãããªãã°ãæååãã®èªçã¯ããªãã¡æåã®æ´å²ã¨ãããã¨ã«ãªãã ãããã¢ããã³ãã«ã¬ã³ãã¼ã¨ãã¦æ¬å½ã¯ãã£ã¨åè¿ãªè©±é¡ãæ¸ãã¦çµããã¤ããã ã£ãããæåã®æ´å²ããæååãã«ã¤ãã¦è«ãã¦ã¿ããã¨æããçè ã®èª¿æ»åã®éçããåºå ¸ããããµããªãã®ãå«ã¾ãã¦ãããã追ã£ã¦å çã»ä¿®æ£ãã¦ããäºå®ã§ããã
æåã®æ´å²
ç¾å¨è¡¨é³æåã¨ãã¦ä½¿ããã¦ããæåã®å¤ãã¯ããã®èµ·æºãå¤ä»£ã¨ã¸ããã®ã¨ã¸ããèªè©±è ã®çºæã§ãããã¨ãã°ãªãã«è¾¿ããã¨ãã§ããããã¨ãã°ãªãã¯å½åãã表ææåã¨ãã¦ç¨ãããã¦ããããæ代ãçµãã«ã¤ããåã ã®æåã表ãåèªã®é åã表é³ããæåã¨ãã¦ãå©ç¨ãããããã«ãªã£ããåãããã¦ãå½åã¯ç¹æ¨©ãæã¤ãã®ã«ã®ã¿å©ç¨ã許ããã¦ãããã¨ãã°ãªãèªä½ã®ãæ°ä¸»åããé²ã¿ããã¨ãã°ãªãã¯ãã¨ã©ãã£ãã¯ããã¢ãã£ãã¯ãªã©ã®æ´¾çãçã¿åºãããã¨ã¸ããçå½ã¯å¤æ°æå½å®¶ã§ãããåãã¢ããã»ã¢ã¸ã¢èªæã§ã¯ãããã®ã®é³é»ä½ç³»ã®éãè¨èªã使ç¨ããæ°æãæ¯é åã«å¤ãå± ä½ãã¦ãããåã«ãã³æåã¯ããããæ°æã®ä¸é¨ãèªãã®è¨èªã®é³ç´ ã表è¨ããããã«ãã¨ãã°ãªãããã¨ã©ãã£ãã¯ã表é³æåã¨ãã¦åç¨ãããã¨ã§çã¾ããæ´¾çã®ä¸ã¤ã§ãããåã«ãã³æåããæ´¾çãããã§ããã¢æåã¯ãã§ããã¢äººã®å人ã«ãã£ã¦å°ä¸æµ·ã®äº¤æã§å¹ åºãå©ç¨ããããã¨ã¨ãªããããããã¯ç¬èªã®æåãæããªãã£ãå°æ¬§èªæ (ã¢ããã»ã¢ã¸ã¢èªæã¨ã¯å ¨ãç°ãªã) ã®è¨èªãç¨ããã®ãªã·ã¢äººãã©ãã³äººã¨ãã£ãæ°æãã¡ã«ãèªãã®è¨èªã表è¨ããæåã¨ãã¦åç¨ãããã«è³ã£ããæ¬æ¥ã¯ã¢ãã¸ã£ã (åé³ã®ã¿ãé³ç´ ã¨ãã¦è¡¨è¨ããæåä½ç³») ã§ãã£ããã§ããã¢æåã®ä¸é¨ã®æåãæ¯é³ã«ä»£ç¨ãã試ã¿ãçããã®ããããããå¾ä¸ã®åç¨ã®ä¸ã§ã®ãã¨ã ã£ãã
ä¸æ¹ãæ¥å½¢æåãåææã«ãã¨ãã°ãªãã¨ã¯ç¬ç«ãã¦å¤ä»£ã¡ã½ãã¿ãã¢ã®ã·ã¥ã¡ã¼ã«èªè©±è ã«ãã£ã¦çºæãããããããå½åã¯çµµæåãããªã表ææåããè¦ã®èã§ç´ç·çãªæ§æè¦ç´ ãããªãè¨å·ãç²åæ¿ã«å»ããã¨ã§è¡¨ç¾ãããããã«ãªãçããã¨èãããã¦ãã (諸説ãã)ãã¾ããä¸é¨ã®æåã¯æ代ã追ããã¨ã«é³ç¯æå (åé³+æ¯é³ãªã©è¤æ°ã®é³ç´ ã表ãæåãæ¥æ¬èªã®ã²ãããªãã«ã¿ã«ãããã®ä¸ç¨®) ã«å¤åãããå½åã¯ã·ã¥ã¡ã¼ã«èªã®è¡¨è¨ã®ããã®æåä½åã§ãã£ãããã·ã¥ã¡ã¼ã«äººã®çå½ãå¾æããå ¬ç¨èªãæ¥å¸¸è¨èªã¨ãã¦ã®ã·ã¥ã¡ã¼ã«èªãå°ä½ã失ã£ã¦ããã¢ãã«ã人ããããã³äºº *1 ãªã©ã»ãã®æ°æã«åç¨ãããå©ç¨ããã¤ã¥ãããæ©ã段éã§è¡¨é³æååãããã¨ãã°ãªãã®è¾¿ã£ãæ´å²ã¨ã¯éãã表ææåã¨ãã¦ã®æ§è³ªã¯ãã®ã¾ã¾åç¨å ã®è¨èªã§ãå¼ãç¶ããã表æã«ç¨ããããæåã¯æå³ãä¿ã¡ã¤ã¤é³ä¾¡ãå¤ããä¸æ¹ã§ãé³ç¯ã¨ãã¦ç¨ããããæåã¯ãã®ã¾ã¾ã®é³ä¾¡ã§ç¶æ¿ãããç¹ã¯èå³æ·±ãç¹ã§ããã
ãã®æåã®æ´å²ãã示åãããå 容ã¨ã¯ä½ãã¨ããã¨ãå¤ä»£ããåãæåãè¤æ°ã®è¨èªã®è¡¨è¨ã«ä½¿ãããã¨ããäºè±¡ã¯çºçãã¦ããããæåèªä½ã¯èªãããæç« ãèªããªããã¨ããäºæ ãçºçãã¦ãããã¨ã§ãããæååãã§ã¯ãªããã人é¡ãåãã¦ä½é¨ãããæåæ å ±ã®äº¤æã«ããã¦éãæã¨åãæã®åæã«ç¸éããããã¨ã§èµ·ãããç¾è±¡ã¯ããã§çºçããã¨èãã¦ããã ããã
æåã®ç¬¦å·åã®æ´å²
æåã®ç¬¦å·åã®èµ·æºãã©ãã«æ±ãããã¯é£ããããã¨ãã°ã·ã¼ã¶ã¼æå·ã¨ãã¦ç¥ãããæå·åã¹ãã¼ã ã¯ãåã ã®æåã«é åºæ§ããããã¨ãæé»ã«ä»®å®ãããã¨ã§åãã¦æãç«ã¤ãã®ã§ãããããã¦ãªã¦ã¹ã»ã«ã¨ãµã«ã®æ代ã§ããç´å å100å¹´ããã«ã¯ãã§ã«ç¬¦å·åã¨ããæ¦å¿µãçãã¦ããã¨ãããããããããè¿ä»£çãªé»åçãªéä¿¡ã¨ããæèã«éå®ãããªãã°ã1800å¹´åå¾ã«å§ã¾ã£ãé»ä¿¡ã®çºæããã®èµ·æºã¨ããè¦æ¹ãã§ããã
æè¡é©æ°ã¨é»ä¿¡
æåæã®é»ä¿¡ã®ä»çµã¿ã¯éé»æ°ã¨ã©ã¤ãã³ç¶ã®ãããªãã£ãã·ã¿ã«ä¾åããå©ç¨ããæå種ãã¨ã«é»ç·ãå¿ è¦ã¨ããã¨ãããã®ã ã£ããããã¯ãå®å®çãªç´æµé»æºãç¨ãã¦æç³»åçãªä¿¡å·ãä½ããã¨ãã§ããªãã£ããã¨ã«ãããã¢ã¬ããµã³ããã»ãã«ã¿ã1800å¹´ã«åå¦é»æ± ãçºæãããã¨ã§äººé¡ã¯åãã¦ä¸æ¬ã®é»ç·ãéãé»æµã«ç¬¦å·ãå¤éåããè¡ãæã«å ¥ããã1825å¹´ã«ã¦ã£ãªã¢ã ã»ã¹ã¿ã¼ã¸ã£ã³ãé»ç£ç³ãçºæã1835å¹´ã®ã¸ã§ã»ãã»ãã³ãªã¼ã¨ã¨ãã¯ã¼ãã»ãã¤ãã¼ãããããç¬ç«ã«ãªã¬ã¼ãçºæããã¨ãæ¸è¡°ãããã«ã¹ä¿¡å·ãå¢å¹ ãããã¨ãå¯è½ã«ãªããé»ä¿¡ãé·è·é¢ã®éä¿¡æ段ã¨ãã¦ä¸æ°ã«å®ç¨æ§ã帯ã³ããã¨ã¨ãªã£ãã
æåã®åç¨é»ä¿¡æ©æ§ã¯1839å¹´ã«ãã£ã¼ã«ã¹ã»ã¦ã£ã¼ãã¹ãã¼ã³ãã«ãã£ã¦éçºããããããã¯æ©æ¢°çãªæ©æ§ãç¨ãã¦ãã«ã¹ãçºçãããåä¿¡å´ã«ããåç¤ä¸ã®éãé»ç£ç³ã§æå®ã®ã¹ãããæ°ã ãå転ããæåãæéããããã¨ã«ããä¼éãããã®ã ã£ãããã®æ¹å¼ã§ã¯éåä¿¡ã«ãããã1æ¬ã¥ã¤ã2æ¬ã®é»ç·ãå¿ è¦ã¨ãããå½ç¶ã ããã®æ©æ§ãç¹°ãè¿ãç¨ãã¦éä¿¡ããã«ã¯ãéä¿¡ã®çµäºå¾ã«ããªããéä¿¡å´ã¨åä¿¡å´ã®éãã¹ã¿ã¼ãä½ç½®ã«æ»ããªããã°ãªããªãããããã®æä½ãæ ã£ãå ´åã«ã¯ãæå³ã®ãªãæååãåä¿¡å´ã«ç¾ãããã¨ã¨ãªãã
é»ä¿¡ã®çºæã¯ãã£ã±ãã¤ã®ãªã¹ãä¸å¿ã«é²ãã§ãããã1844å¹´ã«ã¢ã¡ãªã«äººã®ãµãã¥ã¨ã«ã»ã¢ã¼ã«ã¹ãã¢ã«ãã¬ããã»ã´ã§ã¤ã«ããæåã符å·åãããã¨ã«ãããåäºééä¿¡ãåç·ã§è¡ãé»ä¿¡æ¹å¼ãçºæãããã¢ã¼ã«ã¹ãã®çºæã¯ãªã¼ã¹ããªã¢ãããã¤ã»ã³ããã¤ã¨ã«ã³ãã¶ã¯ã»ã³ããæããã¤ãï¼ãªã¼ã¹ããªã¢é»ä¿¡é£å (AGT) ã«ããã¦1850å¹´ã«å½éé»ä¿¡ã®æ¹å¼ã¨ãã¦æ¡ç¨ãããããããã§æ¡ç¨ããã符å·åæ¹å¼ã¯ã¢ã¼ã«ã¹ã®ãªãªã¸ãã«ã®ç¬¦å·ã¨ã¯å¤§ããç°ãªããã®ã§ãããªã¼ããªãã»ã²ã¼ã«ã±ã®æ¹è¯ããã¼ã¹ã¨ãã¦ããããã®æ¹è¯ã«ã¯ãã¤ãèªã®è¡¨è¨ã«å¿ è¦ãªã¦ã ã©ã¦ãã¨åé³ (ché³) ã符å·ã«å«ã¾ãã¦ãããä¸æ¹ããã©ã³ã¹ã»ãã«ã®ã¼ã»ãµã«ãã¼ãã£çå½ã»ã¹ã¤ã¹ã®4ã«å½ã§1855å¹´ã«è¥¿é¨æ¬§å·é»ä¿¡é£å (WETU) ãçºè¶³ããã
é»ä¿¡ã®éè¦ãæ¥éã«å¢å ãã両è ã®é£æºãå¯ã«ãªãä¸æ¹ã§ãçµè·¯ã®ããªã·ã¼ã«é¢ããå·®ç°ãªã©ãåé¡ã«ãªããã¨ãå°ãªããªãã£ããçµ±ä¸ãå¸æãã声ãé«ã¾ãä¸ã1865å¹´ã®ããªä¸å½é»ä¿¡æ¡ç´ã§ä»æ¥ãé»æ°éä¿¡ã®æ¨æºãçµ±æ¬ããå½éé»æ°éä¿¡é£å (ITUãããã¯UIT) ãçºè¶³ãã1868å¹´ã®ã¦ã£ã¼ã³ä¸å½é»ä¿¡æ¡ç´ã§ã¯æ°ãã«ãã©ã³ã¹èªã¨ã¹ãã¤ã³èªã®è¡¨è¨ã«ç¨ããããæåãå«ããããæ¨æºãå®ããããããããå½éã¢ã¼ã«ã¹ç¬¦å·ã§ããã
é»ä¿¡ã¯1875å¹´ã«ã¢ã¡ãªã«ã®ã¢ã¬ã¯ãµã³ãã¼ã»ã°ã©ãã ã»ãã«ã«ãã£ã¦é»è©±ãçºæãããAT&Tã«ãã£ã¦åç¨åãããã¨ãé»æ°éä¿¡ã®èå°ããã¯å°ããã¤å½±ãæ½ãããã¨ã«ãªãã
ãã¬ã¿ã¤ã (ãã¬ããªã³ã¿)
ãã¬ã¿ã¤ã (ãã¬ããªã³ã¿) ã¯é»ä¿¡ã®æ©æ§ã«ã¿ã¤ãã©ã¤ã¿ã¼ãçµåãããã®ã§ãããæåã®åç¨åããããã¬ã¿ã¤ãã¯1846å¹´ã«ãã¤ã¤ã«ã»ã¢ã¼ã«ã»ãã¦ã¹ãçºæãããã®ã§ãåä¿¡å´ã¯56ã®ã¿ã¤ãããããæã¤ãã¤ã¸ã¼ãã¤ã¼ã«ããªã³ã¿ã®ãããªæ©æ§ãæã¡ãéä¿¡å´ã¯ãã¢ãã®éµç¤ã®ãããª28éµã¨ã·ãããã¼ãæã£ã¦ãããæåã®é¸æã«ã¯ãã«ã¹ãç¨ãã1æéã«2000èªã®éåä¿¡ãå¯è½ã ã£ãã
ãã©ã³ã¹ã®ã¨ãã¼ã«ã»ããã¼ã®æåã®çºæã¯ãããããã¬ã¿ã¤ãã®ä¿¡å·ç·ãä¸å®ã®æéééã§åãæ¿ããåä¸ç·ã§è¤æ°ã®ã¡ãã»ã¼ã¸ãåæéä¿¡ããæåå²å¤éåã ã£ããããããæåãã¨ã®éä¿¡æéãç°ãªããããæåå²ééãåºãããããå¾ããããã«å¹çãé«ããã«ã¯æåã«ãããä¸å®ã®æéã§ä¿¡å·ãéåºããå¿ è¦ããã£ããããã§ããã¼ã¯ãå½æãã£ãæ§ã ãªã¢ã¤ãã£ã¢ãã¤ãªãåããã1874å¹´ (諸説ãã) ã«ã¯5ãããã®ã³ã¼ãã§æåãéåä¿¡ããããã¼ã»ã·ã¹ãã ãå®æããã *2ãããã¼ã»ã·ã¹ãã ã¯5ã¤ã®éµç¤ãæã£ã¦ãããæ©æ¢°ããé³ãããã¾ã§æåã³ã¼ãã«å¯¾å¿ããéµç¤ã®çµã¿åãããæ¼ãç¶ãããã¨ã§1æåãéä¿¡ããããã®æé ã«ããããã1åéã«30èªã®éä¿¡ãå¯è½ã§ãã£ãããã®ã·ã¹ãã ã¯ä¸ã¤ã®ä¿¡å·ç·ãæåå²ãã¦4ã¤ã®ãã¬ã¿ã¤ããæ¥ç¶å¯è½ã ã£ãã®ã§ãä¿¡å·ç·ãããã®ã¹ã«ã¼ãããã¨ãã¦ã¯ãã¦ã¹ã®ã·ã¹ãã ã®3.6åã¨ãããã¨ã«ãªããããã¼ã»ã·ã¹ãã ã®ã³ã¼ãã®ç¹å¾´ã¯ããã¤ãããããç¹çãã¹ãç¹ã¯2ã¤ããã1ã¤ã¯ã¬ã¿ã¼ã±ã¼ã¹ã¨ãã£ã®ã¥ã¢ã±ã¼ã¹ã¨å¼ã°ãã2ã¤ã®ã·ããç¶æ ãæã¡ãã³ã¼ã表ãåãæ¿ãã¦æåãéåä¿¡ããç¶æ ãæã¤ã³ã¼ãã»ããã§ãã£ãã¨ãããã¨ããã1ã¤ã¯Blank (空ç½ã®æ¿å ¥) ã¨Erasure (1æååé¤ã表ã) ã¨ããå¶å¾¡ã³ã¼ããæã£ã¦ãããã¨ã§ããã
ããã¼ã»ã·ã¹ãã ã¯1875å¹´ã«ãã©ã³ã¹é»ä¿¡å±ã«æ£å¼æ¡ç¨ããããã¾ãã1878å¹´ã®ããªä¸åã§ãå ¬éãããã¨ãåå½ã®èå³ãå¼ããã¨ã«ãªãã1897å¹´ã«ã¯è±å½éµæ¿å ¬ç¤¾ãããã¼ã»ã·ã¹ãã ãå°å ¥ããã¤ã®ãªã¹å½å ã«åºã¾ã£ã¦ãã£ããããããã¤ã®ãªã¹ã§ã¯ãã©ã³ã¹èªã®è¨è¿°ã«å¿ è¦ãªä¸é¨ã®ã¢ã«ãã¡ããããå¿ è¦ã¨ããªãã£ããããããã«å¥ã®è¨å·ãå²ãå½ã¦ãç¬èªã®ã³ã¼ãã»ãããæ¡ç¨ãããè¨é²ã«æ®ã£ã¦ããããã§ã¯ãªãããçè ã¯ãã®ã³ã¼ãã»ããã®éãã«ããå½éãã¬ã¿ã¤ãã®å©ç¨æã«æåããåãããäºæ ãçºçãã¦ããã®ã§ã¯ãªããã¨æ¨æ¸¬ããã
1901å¹´ããããªã¼ã¹ãã©ãªã¢ã§ã·ããã¼ã®æ°è社ã«ã¨ã³ã¸ãã¢ã¨ãã¦å¤åãã¦ããããã«ãã»ãã¬ã¼ã¯ã¿ã¤ãã©ã¤ã¿ã¼ç¶ã®ãã¼ãã¼ãã¨ãã¬ã¿ã¤ããçµåããã·ã¹ãã ãèæ¡ãããå½æã®æ°è社ã§ã¯ã¿ã¤ãã©ã¤ã¿ã¼ãåºãæ®åãã¦ãããå¤ãã®ãªãã¬ã¼ã¿ãããããQWERTYãã¼é ç½®ã«æ £ãã¦ããããã¬ã¼ã¯ãä½ãæè²ã³ã¹ãã§ãã¬ã¿ã¤ããå©ç¨å¯è½ã«ããã·ã¹ãã ã¨ãã¦ãã®æ§æãçã¿åºããããã¬ã¼ã®ã·ã¹ãã ã¯ãã¿ã¤ãã©ã¤ã¿ã¼ã¨åããã¼é åãæã¡ãç´ãã¼ãã«ç©¿åã空ããããã®ãã¼ãã©ã¬ã¼ã¿ã¨ããã®ç´ãã¼ãã«è¨é²ãããæåã³ã¼ãã«åºã¥ãã¦ã¡ãã»ã¼ã¸ãéåºãããã©ã³ã¹ããã¿ã®2ã¤ããæ§æããã¦ãããããã¼ã»ã·ã¹ãã ã®ã³ã¼ãã¯ãªãã¬ã¼ã¿ãè¦ãããããããªå²ãå½ã¦ãããã¦ãããããã¬ã¼ã¯ãã®ã·ã¹ãã ã§ã¯ãã®ãããªèæ ®ã¯ãã¯ãä¸è¦ã§ãããã¨ã«æ°ã¥ããæ©æ¢°ã®æ©èãèæ ®ãã¦ä½¿ç¨é »åº¦ã®é«ãæåã«ã¤ãã¦ã¯ããå°ãªãç©¿åã§æ¸ããããªã³ã¼ãä½ç³»ãæ°ãã«èæ¡ãããã¾ããç¾å¨ã§ã¯ãã£ãªãã¸ã»ãªã¿ã¼ã³ãã©ã¤ã³ã»ãã£ã¼ãã¨å¼ã°ãããããªå¶å¾¡ã³ã¼ããçã¿åºããã
ã¢ã¡ãªã«ã®ãã¬ã¿ã¤ãã®å¤§æã§ãã£ãã¦ã§ã¹ã¿ã³ã¦ããªã³ã¯ããã®ãã¬ã¼ã®ã³ã¼ããæ¡ç¨ããããã«ããã¤ãã®å¶å¾¡ã³ã¼ãã追å ããæ¹è¯ãè¡ã£ãããã®æ°ããã³ã¼ãã¯ããã«ITUã®ä¸é¨éã§ããCCITT (ç¾ITU-T) ã§ITA2ã¨ãã¦æ¨æºåããããITA2ã®ã³ã¼ã表ã¯æ¬¡ã®ãããªãã®ã§ãã£ãã
ããããã¿ã¼ã³ | ã¬ã¿ã¼ã±ã¼ã¹ | ãã£ã®ã¥ã¢ã±ã¼ã¹ |
---|---|---|
00000 (0) |
n/a | n/a |
00001 (1) |
T |
5 |
00010 (2) |
CR | CR |
00011 (3) |
O |
9 |
00100 (4) |
SP | SP |
00101 (5) |
H |
åå½æåç¨ |
00110 (6) |
N |
, |
00111 (7) |
M |
. |
01000 (8) |
LF | LF |
01001 (9) |
L |
) |
01010 (10) |
R |
4 |
01011 (11) |
G |
åå½æåç¨ |
01100 (12) |
I |
8 |
01101 (13) |
P |
O |
01110 (14) |
C |
: |
01111 (15) |
V |
= ã¾ã㯠; |
10000 (16) |
E |
3 |
10001 (17) |
Z |
+ ã¾ã㯠" |
10010 (18) |
D |
ã¢ã³ãµã¼ãã㯠|
10011 (19) |
B |
? |
10100 (20) |
S |
' |
10101 (21) |
Y |
6 |
10110 (22) |
F |
åå½æåç¨ |
10111 (23) |
X |
/ |
11000 (24) |
A |
- |
11001 (25) |
W |
2 |
11010 (26) |
J |
ãã« |
11011 (27) |
ãã£ã®ã¥ã¢ã·ãã | ãã£ã®ã¥ã¢ã·ãã |
11100 (28) |
U |
7 |
11101 (29) |
Q |
1 |
11110 (30) |
K |
( |
11111 (30) |
ã¬ã¿ã¼ã·ãã | ã¬ã¿ã¼ã·ãã |
åå½æåç¨ (National Use) ã¨ããè¨ãæ¹ã¯ç¾ä»£ã§ã¯ä¸é©åã§ãããããããã®ã³ã¼ãã¯ããã¬ã¿ã¤ãã®å©ç¨å½ã§å¿ è¦ã¨ãããæåãå²ãå½ã¦ãã¨ãããã®ã§ãã£ãããã¨ãã°ãã¤ãã§ããã°ã¦ã ã©ã¦ãã§ããã
ãã®ITA2ã¯ç¬¬äºæ¬¡ä¸ç大æ¦å¾ãITU-T T.50ãããã¯ISO 646ãããã¯ASCIIã¨ãã¦ç¥ãããããã«ãªãã³ã¼ãã»ããã®ååã¨ãªãã
ãã³ãã«ã¼ã
æ©æ¢°ã§èªã¿åãå¯è½ãªæ å ±åªä½ã¨ãã¦ã®ãçééã«ãã³ããã¼ã«ã空ããããç´ãã¼ãã¯1700年代ããç¹æ©ã®å¶å¾¡ã«ç¨ãããã1801å¹´ã®ã¸ã£ã«ã¼ãç¹æ©ã®çºæã«çµå®ãããªã©ããã§ã«ãã®å¿ç¨æ§ã«ã¤ãã¦ã¯ç¥ããã¦ããããæ å ±å¦çã«ä½¿ãããã¾ã§ã«ã¯19ä¸ç´æ«ããã¼ãã³ã»ãã¬ãªã¹ã®ä½è¡¨æ©ã¨ãã³ãã«ã¼ãã®çºæãå¾ ããªããã°ãªããªãã£ãããã¬ãªã¹ã®è¨ç«ããTabulating Machine Companyã¯ä»ã®4社ã¨åä½µããã®ã¡ã«International Business Machineã¨ååãå¤ããComputing-Tabulatiing-Recording Companyã¨ãªãã
1920年代ã®çµããã45æ¡12è¡ã¨ãããã³ãã«ã¼ãã®å®¹éã®å¢å¤§ãæ±ãã顧客ã¸ã®å¯¾å¿ã¨ãã¦ãIBMã®ç¤¾é·ã§ãã£ããã¼ãã¹ã»Jã»ã¯ãã½ã³ã¯ãã³ãã«ã¼ãã®å¤§ãããå¤ããã«å®¹éãå¢ããæ¹æ³ãèæ¡ããããäºäººã®ç¤¾å¡ã«è¦æ±ããããã®çµæãç©´ã®å½¢ç¶ãé·æ¹å½¢ã«ããã«ã©ã å¹ ãçãã¦80æ¡12è¡ã«ããã¨ããæ¹æ³ã«è½ã¡çãã *3ããã®è¦æ ¼ã«åºã¥ãã¦ã1932å¹´ã«IBMã¯ã¾ã¼ã³ãã³ãä½ç½®ãå«ã12è¡ã®ãã³ãã«ã¼ãã§è±åã®å¤§æåãæ°åã¨ä¸é¨ã®è¨å·ã表ç¾å¯è½ãªç¬¦å·ãèæ¡ãããããã¯BCDIC (Binary Coded Decimal InterChange Code) ã¨ãã¦ç¥ããã符å·åæ¹å¼ã®å ã¨ãªã£ãã
æåã®ãã¼ã¸ã§ã³ã®BCDICã®ã³ã¼ã表ã¯æ¬¡ã®ãããªãã®ã§ãã£ãã
- | A | B | BA | |
---|---|---|---|---|
0 | SP |
n/a | - |
& |
1 | 1 |
n/a | J |
A |
2 | 2 |
S |
K |
B |
3 | 3 |
T |
L |
C |
4 | 4 |
U |
M |
D |
5 | 5 |
V |
N |
E |
6 | 6 |
W |
O |
F |
7 | 7 |
X |
P |
G |
8 | 8 |
Y |
Q |
H |
9 | 9 |
Z |
R |
I |
10 | 0 |
n/a | n/a | n/a |
11 | n/a | n/a | n/a | n/a |
12 | n/a | n/a | * |
n/a |
ãã®ç¸¦13è¡ã®ãã¡ã0è¡ç®ã¯ç©¿åãªããæå³ãã¦ããããã以å¤ã¯ãã³ãã«ã¼ãã®12è¡ã«å¯¾å¿ãã¦ãããä¸è¨ã®ã³ã¼ã表ã®è¡ã¨ãã³ãä½ç½®ã®å¯¾å¿ã¯ä»¥ä¸ã®ããã«ãªãã
ãã³ãã«ã¼ãã®è¡ä½ç½® | ã³ã¼ã表ã®è¡ä½ç½® | ã¾ã¼ã³ãã³ã? |
---|---|---|
12 | 12 | y |
11 | 11 | y |
0 | 10 | y |
1 | 1 | n |
2 | 2 | n |
3 | 3 | n |
4 | 4 | n |
5 | 5 | n |
6 | 6 | n |
7 | 7 | n |
8 | 8 | n |
9 | 9 | n |
8-X | 8 + X | n |
ã¾ããA
B
BA
ã¯0, 11, 12è¡ç®ã®ã¾ã¼ã³ãã³ãã®ç©¿åç¶æ
ã示ãã¦ããã
- ãã³ãã«ã¼ãã®0è¡ç®ã®ã¿ã«ç©¿åãããå ´åãããã¯æå
0
ã表ãã - ãã³ãã«ã¼ãã®0è¡ç®ã¨2è¡ç®ã«ç©¿åãããå ´åãããã¯æå
S
ã表ãã - ãã³ãã«ã¼ãã®11è¡ç®ã®ã¿ã«ç©¿åãããå ´åãããã¯æå
-
ã表ãã - ãã³ãã«ã¼ãã®11è¡ç®ã¨8è¡ç®ã¨4è¡ç®ã«ç©¿åãããå ´åãããã¯æå
*
ã表ãã
ãã®ã³ã¼ãä½ç³»ã¯ããã¾ã§ä½è¡¨æ©ã®ããã«çã¾ãããã®ã§ãã£ãããä½è¡¨æ©ãé»æ°çãªæ¹æ³ã«ãã£ã¦ãã³ãã«ã¼ãã®æ å ±ãå¦çãã¦ãããã¨ããã第äºæ¬¡ä¸ç大æ¦å¾ã«åç¨åãããã³ã³ãã¥ã¼ã¿ã®è¨é²åªä½ã¨ãã¦ç¨ããããã®ã¯èªç¶ãªãã¨ã ã£ãã1953å¹´ã«çºè¡¨ãããIBM 702ã¯ããã®40æåã®ã³ã¼ããããã«48æåã«ã¾ã§æ¡å¼µãããã®ã³ã¼ããBCDICã¨åä»ãããæãåãããã¦ãFORTRANã®ãããªé«æ°´æºã®ããã°ã©ãã³ã°è¨èªãçã¾ãç¹å®ã®è¨å·ã¸ã®éè¦ãçãããã¨ãè±èªä»¥å¤ã®è¨èªãç¨ããå½ã§ã®éè¦ãçãããã¨ãããBCDICã®æåã®ä¸é¨ãå ¥ãæ¿ããã³ã¼ãã»ããã®ããªã¨ã¼ã·ã§ã³ (duals) ãè¤æ°çã¾ããããã®ãã¨ã§ãå¾æ¥ã®æåã»ãããåæã¨ããç°å¢ã§FORTRANç¨ã®BCDICã³ã¼ãã»ãããç¨ããã¨è¨å·ããåãããã¨ããäºæ ãçãããä¾ãã°
X=(A+B)*(C-D)/(E+F*G)
ã¨ããFORTRANã®ããã°ã©ã ã¯ãªãªã¸ãã«ã®BCDICã§ã¯
X#%A&B¤*%C-D¤/%E&F*G¤
ã¨ãªã£ã¦ãã¾ããç¹ã«ãã®åé¡ã¯ãç¹å®ã®ã³ã¼ãã»ãããåæã«ä½ããã¦ããããªã³ã¿ã®å©ç¨ã«ããã¦æ·±å»ã§ãã£ãã
ããã«äººã ã¯ãã®åé¡ã«è¦ããããããã¨ã«ãªãããããªãBCDICã®æ¡å¼µãæ±ããããããæçµçãªè§£æ±ºã¯EBCDICã®èªçãå¾ ã¤ãã¨ã«ãªãã
åèæç®
- Naveh Joseph, æ´¥æ ä¿å¤«, 竹å è夫, ç¨²å£ ç·ç´å訳 (2000). åæã®ã¢ã«ãã¡ãããã®æ´å². æ³æ¿å¤§å¦åºçå±.
- å®å²¡åä¸. å½éã¢ã¼ã«ã¹ç¬¦å·ã®èªç, http://kanji.zinbun.kyoto-u.ac.jp/~yasuoka/publications/Morse.html
- Pre-1865 International Telegraph Agreement. History of ITU portal, https://www.itu.int/en/history/Pages/Pre1865Agreements.aspx
- Mackenzie, Charles E. (1980) Coded Character Sets: History and Development. Addison-Wesley.
- IBM 7090 Data Processing System Reference Manual (1962). http://www.mirrorservice.org/sites/www.bitsavers.org/pdf/ibm/7090/22-6528-4_7090Manual.pdf
*1:æ§ç´èæ¸ã®ãããã«ã®å¡ãã¯ä¸èª¬ã«ããã¨ããããã¢ã«å»ºç«ãããå¡ã§ããã¨ããã
*2:ç¾ä»£ã®ã·ãªã¢ã«éä¿¡ã§ç¨ãããããã¼ã¬ã¼ãã¨å¼ã°ããæ¦å¿µã¯ãããã¼ã®åããæ¥ã¦ãã
*3:ä½è«ã ããã®80æ¡ã¨ããæ°åã¯ç«¯æ«ã®æ¨æºçãªæ¡æ°ã®ãã¨ã¨ãªã£ããã®ã§ããã
Goãªããããã·ã¹ãã ããã°ã©ãã³ã°ç¬¬2çãåºãã®ã§æ¸è©ãã¾ãã
å°ãåã«ãªãã¾ããã3æ23æ¥ã«ãæ¸å·ãããããã®èããããGoãªããããã·ã¹ãã ããã°ã©ãã³ã° 第2ç ããçºå£²ããã¾ãããåçã¨æ¯ã¹ã¦ããªãå çããã¦ãããã¯ã¼ã¢ãããã¦ããã®ã§ãåçããã§ã«ãæã¡ã®æ¹ã§ãããã«èå³æ·±ãèªããã¨ã®ã§ããå 容ã«ä»ä¸ãã£ã¦ãããã¨ããã®ã第ä¸å°è±¡ã§ãã
æ®å¿µãªããåççºå£²æã«è¨äºã«ããæ©ä¼ããªãã£ãã®ã§ãããããããã¦ä»åæ¸è©ããããªã¨æãã¾ããã®ã§ãå¾ç¶æ¸ãã¦ããããã¨æãã¾ãã
ãã®æ¬ã¯å®ã¯ã·ã¹ãã ããã°ã©ãã³ã°ã®æ¬ã§ã¯ãªããããããªã
ãã·ã¹ãã ããã°ã©ãã³ã°ãã¨ã¯ä½ã§ããããæ£ç´ç§ã«ããããã¾ããããã®èªãã¯ããã«æãæµ®ãã¹ã人ã¯ãããã°ã©ãã³ã°ã¨ããæ¦å¿µã®ãã®ä¸ã«ããã¦ãã·ã¹ãã ããã°ã©ãã³ã°ãã¨ããåé¡ãä½ããã¨æãè³ã£ãã¨ãããã¨ã§ãããããã£ã¨ãéã·ã¹ãã ããã°ã©ãã³ã°ãã¨ãããã®ãããã¨ãããã¨ã§ããããç¥ãããã©ãããããããã¯æ¬æ¸ã®ä½ç½®ã¥ããè°è«ããä¸ã§éè¦ãªè¦ç¹ã¨ãªãã¾ãã
æ¸è©ããç«å ´ãªãã大å¤ç³ã訳ãªããã¨ã«è¦èããªããã®ã§ãã¤ãWikipediaãè¦ã¦ãã¾ãããã§ãããæ¢ãã¦ã¿ãã¨ãSystems programmingãã¨ããè¨äºãè¦ã¤ããã¾ããããããæåã«ä½ãããã®ã¯2003å¹´ã¨ã®ãã¨ãªã®ã§ãããç¨åº¦ä¿¡é ¼ãæã£ã¦çºãã¦ãè¯ãããã§ã¯ããã¾ããå½è©²è¨äºã®åé ããå¼ç¨ãã¦ã¿ã¾ãã
Systems programming, or system programming, is the activity of programming computer system software. The primary distinguishing characteristic of systems programming when compared to application programming is that application programming aims to produce software which provides services to the user directly (e.g. word processor), whereas systems programming aims to produce software and software platforms which provide services to other software, are performance constrained, or both (e.g. operating systems, computational science applications, game engines, industrial automation, and software as a service applications).
ãã®è¨äºã«ããã°ããã¢ããªã±ã¼ã·ã§ã³ããã°ã©ãã³ã°ãã¨ããæ¦å¿µãããããã·ã¹ãã ããã°ã©ãã³ã°ãã¨ã®éãã¯ãã¢ããªã±ã¼ã·ã§ã³ããã°ã©ãã³ã°ã¯ã¦ã¼ã¶ã¼ã«ç´æ¥ãµã¼ãã¹ãæä¾ãããã®ã§ããä¸æ¹ãã·ã¹ãã ããã°ã©ãã³ã°ã¯ãã®ä»ã®ã¢ããªã±ã¼ã·ã§ã³ã«ãµã¼ãã¹ãæä¾ãããã®ã§ãããã¨ã®ãã¨ã§ãããªãã»ã©ããéã·ã¹ãã ããã°ã©ãã³ã°ãã¨ããã®ã¯ãã¢ããªã±ã¼ã·ã§ã³ããã°ã©ãã³ã°ãã®ãã¨ãªã®ãããããªããããããã¨ãã·ã¹ãã ããã°ã©ãã³ã°ã¯ãªãã¬ã¼ãã£ã³ã°ã·ã¹ãã èªä½ãã¾ãã¯ããã«é¢ãããã®ã®ããã°ã©ãã³ã°ã¨ããè¨ãæ¹ãæ«å®çã«ã¯ã§ãããããããªãã
ã·ã¹ãã ããã°ã©ãã³ã°è¨èªã¨ã¯?
ã¨ããã§ããã·ã¹ãã ããã°ã©ãã³ã°è¨èªãã¨ããè¨ãæ¹ãããã¾ããããã¯ããã§ç¬ç«ããè¨äºãSystems programming languageããåå¨ããã®ã§ãã¡ããçºãã¦ã¿ããã¨ã«ãã¾ãããã
A system programming language is a programming language used for system programming; such languages are designed for writing system software, which usually requires different development approaches when compared with application software. Edsger Dijkstra refers to these language as Machine Oriented High Order Languages, or mohol.
ãã·ã¹ãã ããã°ã©ãã³ã°è¨èªã¨ããã®ã¯ãã¢ããªã±ã¼ã·ã§ã³ã½ããã¦ã§ã¢ãéçºããã®ã¨ã¯ç°ãªãã¢ããã¼ããè¦æ±ãããã·ã¹ãã ã½ããã¦ã§ã¢ãè¨è¿°ããã®ã«é©ããè¨èªã§ãããã¨è¿°ã¹ã¦ãã¾ããããã¦ããã®ãããªè¨èªãã¨ãã¬ã¼ã»ãã¤ã¯ã¹ãã©ã¯ãæ©æ¢°å¿åé«éè¨èªãã¨å¼ãã ã¨è¿°ã¹ã¦ãã¾ãã(åè: https://www.dijkstrascry.com/node/121 )
æããã¦ãMachine Oriented High Order Languagesã(MOHOL) ã¨ããå¼ç§°ãæãã¤ããã®ããã¤ã¯ã¹ãã©ã§ãã£ãã®ãã©ããã¯ä¸æã§ãããå½è©²è¨äºã«ããã°ãã®å¼ç§°ã¯1973å¹´ã«åãªã©ã³ãã§éå¬ãããIFIP working conferenceã®ãã¤ã¸ã§ã¹ã [1] ã«ç»å ´ããããã§ããSoftware: Practice and Experienceã®Volume 7, Issue 1 (1977) ã«æ²è¼ãããS. H. Valentineã«ããå½è©²ãã¤ã¸ã§ã¹ãã®æ¸è©ãå¼ç¨ãã¾ãããªããæ代èæ¯ã®ç解ãå©ããããã«è¨ãã¨ãCãçã¾ããã®ã¯1972å¹´ã¨ãããã¦ãã¾ãã
Machine Oriented Higher Level Languages turned out to be a slightly contentious title. There was a good deal of discussion about the nature of Machine Oriented Languages (MOLâs) and their relationship to System Implementation Languages (SILâs). Some of the desirable features of the latter were identified, such as high implementation efficiency and the ability to manipulate complicated data structures. It was admitted that these features may be of interest in other programming contexts as well, and several of the proposals for SIL design throughout the book included features which would be of general applicability. System implementors, however, are perhaps as a group more willing than others to learn a new programming language to achieve their aims. They may also in the near future be the only group who are prepared to accept any machine-dependency at all.
There seemed to be general agreement that assembly languages should be abandoned, and it appears that the manufacturers share this view. There were clear disagreements on what should replace them. A paper by Barreveld describes ALIAS, a machine-independent language intended for minicomputers, with a high-level syntax but low-level semantics, with no typing of data and an explicit dereferencing operator inspired by BLISS. Other language designers have gone for fully typed semantics. These tend to be influenced by existing high-level languages like Algol 68 and PASCAL. A paper by Conradi and Holager makes a study of MARY, a language of this class, on the question of the typing of data. There were some sharp disagreements expressed on this issue in the final panel discussion.
ãã®ä¸æã¯æ¬æ¸ã«ç«ã¡è¿ã£ã¦ãé常ã«è²´éãªæ´å¯ãä¸ãã¾ããå¼ç¨ã®æ訳ãé ã«è¨ãã¾ãã
ã¾ãæåã®æ®µè½ã§ããã
æ©æ¢°å¿åé«æ°´æºè¨èª (Machine Oriented Higher Level Languages) ã¨ããã®ã¯ãããããè°è«ãå¼ã¶è¡¨é¡ã§ãã£ãã MOL (æ©æ¢°å¿åè¨èª) ã®æ§è³ªã¨ããããã®SIL (ã·ã¹ãã å®è£ è¨èª) ã¨ã®é¢ä¿æ§ã«ã¤ãã¦ã¯ãããã¾ã§ãã¾ãã¾ãªè°è«ããã£ããã ããå¾è ã®æã¾ããç¹å¾´ã¨ããã®ã¯ããã¤ãå¤æãã¦ããããã¨ãã°ãè¤éãªãã¼ã¿æ§é ãæä½ããå¹çãè½åã¨ãã£ããã®ã§ããããã®ãããªç¹å¾´ã¯ããã°ã©ãã³ã°ã«ãããä»ã®å´é¢ã§ãéè¦ãããããã®ã§ãããåèãéãã¦è¿°ã¹ãããSILã®è¨è¨ã«é¢ããææ¡ã®ä¸ã«ããããåºç¯ã«é©ç¨å¯è½ãªãã®ããããéå£ã¨ãã¦ã®ã·ã¹ãã ããã°ã©ã (ã·ã¹ãã å®è£ è ) ã¯ãèªãã®ç®çã®ããã«ãä» (ã®å®è£ è ) ã¨æ¯ã¹ã¦æ°ããããã°ã©ãã³ã°è¨èªãå¦ã¶ãã¨ã«ç©æ¥µçã§ããã¨ãããããã¾ããã·ã¹ãã ããã°ã©ãã¯ãè¿ãå°æ¥æ©æ¢°ä¾åæ§ã許容ãããå¯ä¸ã®éå£ã¨ãªããããããªãã
MOLãããã·ã¹ãã ããã°ã©ãã³ã°è¨èªãæããèªã§ããã®ãã¨æãããããã·ã¹ãã å®è£ è¨èªãã¨ããè¨èãåºã¦ãã¾ããã·ã¹ãã å®è£ è¨èªãæåéã解éããã°ã·ã¹ãã ããã°ã©ãã³ã°è¨èªã¨ãªãã®ã§ãå°ãæ··ä¹±ãã¦ãã¾ãããSILã®æ£ä½ãä½ã§ãããã¯å¥ã¨ãã¦ãMOLã¨ã®éãã¯ãè¤éãªãã¼ã¿æ§é ãæä½ããåãã§ããããã§ããæä½ã§ããã¨ããããã«ã¯ãããã«å¯¾å¿ããè¨è¿°åãåãã£ã¦ããã¨æ¨æ¸¬ãã¦ã大ããééã£ã¦ããªãã§ãããããããè¤éãªãã¼ã¿æ§é ãè¨è¿°ããåãã¨è¨ãæãã¦ã許ãããã®ã§ã¯ãªãã§ããããã
ãã®é¨åãç¾ä»£ããããã¨ãä½ãè¨ã£ã¦ããã ãã¨ãªããããªãã®ã§ãããå½æããªãã¬ã¼ãã£ã³ã°ã·ã¹ãã ã®è¤éãã«æ¯ã¹ãã°ãã¢ããªã±ã¼ã·ã§ã³ã¯é常ã«åç´ã§ãã£ãã¨ããç¹ãèæ ®ããªããã°ãªããªãã§ããããã·ã¹ãã ããã°ã©ãã³ã°ã¯ç¸å¯¾çã«èªç¥è² è·ãé«ãè¡çºã§ãããããã軽æ¸ãããã¨ã®ã§ãã (é«æ°´æºãª) ããã°ã©ãã³ã°è¨èªããããªãã°ãããé¸ã³ããã¨ããåæ©ã¯ã·ã¹ãã ããã°ã©ãã«å¼·ãããä¸æ¹ã§ãæ¬è³ªçã«ã·ã¹ãã ããã°ã©ãã³ã°ã¯ãã·ã³ã¢ã¼ããã¯ãã£ã®è©³ç´°ã«ã触ããå¿ è¦ããããã®ã§ããã¨ãããã¨ã§ãã
å®éããã®æ代ã¯ç¸åããã¨ãè¨ãããããã®è¦ä»¶ã両ç«ããææ¦ã¨ãã¦ãã¢ã«ãããã¯ã«ãã½ããã¦ã§ã¢ç£æ¥ã¨ãã¦ãçãã«å®é¨ãè¡ããã¦ããã®ã§ãã2002å¹´ã«Software: Practice and Experienceã«æ²è¼ãããThe BLISS programming language: a history.ã¨ããè¨äº [2] ã«ã¯ã次ã®ãããªè¨è¿°ãããã¾ãã
In the late 1960s and early 1970s, the use of high-level languages for systems programming was highly controversial. Most systems had very limited amounts of main memory; indeed, even so-called large systems generally had hardware maximum address space limitations of 16 or 18-bits of addressable memoryâand no virtual memory support either. âSize is the goalâ for both code and data often summarized one side of the debate. Systems programmers wanted lots of control over every instruction and every cycle and every bit of memory used. The advocates for using high-level languages cited the potential for improved productivity and reduced error rates through the use of structured programming and data abstraction. However, the languages that seemed expressive enough for the job at the time, languages such as PL/I or Algol 68, were not viewed as suitably efficient. Arguments raged over whether it was even conceivable, let alone practical, for compilers to produce code that was within some small incremental percentage of what could be achieved by good programmers. No one ever picked zero. Lots of experimentation was in progress throughout the computer industry seeking languages with the right blend of high-level features, low-level control, ease of compiling to efficient code, and improved optimization technology. The few, then contemporary, languages that fit these goals according to the earliest paper on BLISS were EPL (âEarly PL/Iâ, a bootstrapping PL/I subset used for Multics), Burroughs Extended Algol, PL360 and BCPL.
訳:
1960年代å¾åãã1970年代ååã«ããã¦ãã·ã¹ãã ããã°ã©ãã³ã°ã«é«æ°´æºè¨èªãæ¡ç¨ãããã¨ã¯ãããªãå¦å®çã«ã¨ããããã¦ãã¾ãããå¤ãã®ã·ã¹ãã ã¯é常ã«éãããã¡ã¤ã³ã¡ã¢ãªããåãã¦ãããã大åã·ã¹ãã ã¨è¨ããããã®ã§ãã16ããããã18ãããã®ã¢ãã¬ã¹ç©ºéã®ã¡ã¢ãªããæ±ããªããã¼ãã¦ã§ã¢ããæã£ã¦ãããä»®æ³ã¡ã¢ãªã®ãµãã¼ããããã¾ããã§ãããå½æã®è°è«ã®ååã¯ã³ã¼ãã«ãã¦ããã¼ã¿ã«ãã¦ãããµã¤ãºãããã´ã¼ã«ãã¨ããè¨èã«å°½ãã¾ãã ä»æ¹ãé«æ°´æºè¨èªãæ¨ãå´ã¯ãæ§é åããã°ã©ãã³ã°ããã¼ã¿æ½è±¡åãéãã¦é«ãçç£æ§ã¨ããä½ããã°çºççãéæã§ããä½å°ããããã¨ã強調ãã¦ãã¾ãããããããå½æã·ã¹ãã ããã°ã©ãã³ã°ã«ããã¦ãã®ãããªè¨èªã«ãåå表ç¾åãããã¨èãããã¦ããã«ãããããããPL/IãAlgol 68ã¨ãã£ãè¨èªã¯ç®çã«ç §ããã¦å¹ççã¨ã¯èãããã¦ãã¾ããã§ãããè°è«ã¯ç½ç±ããå®ç¨çãã©ããã®ç¯çãè¶ ãã¦ãæããã¦ã©ã®ç¨åº¦ãã³ã³ãã¤ã©ã®çæããã³ã¼ãããè ã®ãã¤ããã°ã©ãã¼ã®æ¸ã (ã¢ã»ã³ããªè¨èªã®) ã³ã¼ãã«èèã§ããããã¨ããã¨ããã«ã¾ã§è³ãã¾ãããããã誰ä¸äººéããã¼ãã¨ã¯è¨ãã¾ããã§ããã é«æ°´æºè¨èªã®ç¹å¾´ãä½æ°´æºè¨èªã®åãåãã®è¯ããå¹ççãªã³ã¼ãçæã®å®¹æããããé²ãã æé©åæè¡ããã©ã³ã¹ããæ··ãã£ãè¨èªãæ¢ã試ã¿ãã³ã³ãã¥ã¼ã¿æ¥çå ¨ä½ã§è¡ããã¦ãã¾ããããã®ä¸ã§ãæ°å°ãªããç¾ä»£ã«ãæ®ãè¨èªã®ä¸ã§ãBLISSã®åæã®è«æã«ãã®ç®çãæºãããã®ã¨è¿°ã¹ããã¦ãããã®ã¯EPL (ãEarly PL/Iãã¨ãããMulticsã®ãã¼ãã¹ãã©ããã«ç¨ããããPL/Iã®ãµãã»ããè¨èª) ã¨ãããã¼ãºç¤¾ã®æ¡å¼µAlgolãPL360ãããããBCPLã§ããã
æåã®MOLã¨SILã®å¯¾æ¯ãä½ãæå³ããã®ãã«ã¤ãã¦ã®çãã¯ããã®é¨åã®åç §ã«ããããã«ãåè ãä½æ°´æºè¨èªãå¾è ãé«æ°´æºè¨èªãã¨ããããã«èãã¦ããããã§ããMOã¨HLã®ä¸¡æ¹ã®æ§è³ªãå ¼ãåããããã®è°è«ã®æç¹ã§ã¯ã¾ã åå¨ãã¦ããªãã£ãMOHLã模索ãã¦ããã¨ãããã¨ã§ãã
ãã¦ãä¸æ¦ãã¨ã®æç« ã«æ»ãã¾ãã
ã¢ã»ã³ããªè¨èªã¯ãããæ¾æ£ãããã¹ãã§ãããã¨ããè¦è§£ã«ã¤ãã¦ã¯åºãåæãããããã«æãããããã¾ãã(è¨ç®æ©) ã¡ã¼ã«ã¼ããããæ¯æãã¦ããããã ããä¸æ¹ã§ä½ã§ãã£ã¦ç½®ãæããã¹ããã¨ããç¹ã§ã¯æãããªæè¦ã®ç¸éããããBarreveldã®è«æã®ALIASã¯ãBLISSã®å½±é¿ãåããåãªããã¼ã¿ã¨æ示çãªããªãã¡ã¬ã³ã¹æ¼ç®åãæã¤ã¨ãããé«æ°´æºã®ææ³ã¨ä½æ°´æºã®ã»ãã³ãã£ã¯ã¹ãå ¼ãåãããããã³ã³ãã¥ã¼ã¿åãã®æ©æ¢°éä¾åè¨èªã§ãããä»ã®è¨èªè¨è¨è ã¯å®å ¨ã«åä»ããããã»ãã³ãã£ã¯ã¹ã好ãã§ããããã®ãããªè¨èªã«ã¯Algol 68ãPASCALã¨ãã£ãæ¢åã®é«æ°´æºè¨èªã«å½±é¿ããããã®ãå¤ããConradiã¨Holagarã®è«æã¯ããã®ç¨®ã®MARYã¨ããè¨èªã«ã¤ãã¦ããã¼ã¿ã®åã¥ãã®æå¹æ§ãæ¤è¨ãããã®ã§ããããã®åé¡ã«ã¤ãã¦ã¯æå¾ã®ããã«ãã£ã¹ã«ãã·ã§ã³ã§ããªãæ確ãªæè¦ã®é£ãéããè¦ãããã
BLISS ã¯1969å¹´ã«ã«ã¼ãã®ã¼ã¡ãã³å¤§å¦ã§éçºãããä¸æã¯ãã«ç 究æã§Cã¨ã·ã¹ãã ããã°ã©ãã³ã°è¨èªã®åº§ãäºã£ãã¨ããçµç·¯ã®ããè¨èªã§ããããã®è¨èªã¯åã¨ããåã®ããªã¨ã¼ã·ã§ã³ãæããããã¹ã¦ã®å¤æ°ãå®æ°ãã¢ã¼ããã¯ãã£ä¾åã®ãã«ã¯ã¼ãã®æ´æ°å¤ (ä¾ãã°PDP-11ãã¿ã¼ã²ããã¨ãããªãã°16ããããPDP-10ãã¿ã¼ã²ããã¨ãããªãã°36ããã) ãæ ¼ç´ããã¨ããä»æ§ã§ãããã¾ããããã¯å½æã®ããã³ã³ãã¥ã¼ã¿ã®ä¸»æµã¢ã¼ããã¯ãã£ã«ç±æ¥ããã¨æãããã®ã§ããããã¹ã¦ã®å¤æ°ã¯ä½ããã®ã¡ã¢ãªç©ºéä¸ã®ã¢ãã¬ã¹ã«å¯¾å¿ãã¦ãããå¤æ°ã®è¡¨ãå¤ã¯ãã®å¤ã§ã¯ãªãã¢ãã¬ã¹ã¨ããã»ãã³ãã£ã¯ã¹ãæ¡ç¨ãã¦ãã¾ããããã®ãããå¤æ°ã®å¤ãåãåºããããå¤ãæ ¼ç´ããé (ããªãã¡ã¬ã³ã¹) ã«ã¯ .
è¨å·ãå¤æ°ã®åã«ç½®ãå¿
è¦ãããã¾ããé«æ°´æºã®ææ³ã¨ããã©ããã»ãã³ãã£ã¯ã¹ã¯é常ã«åå§çã§ããã¤ã¢ã¼ããã¯ãã£ä¾åã§ããããããçç£æ§ã®é«ãè¨èªã¨èãããã¦ããã¨ãããã¨ã¯é常ã«èå³æ·±ãç¹ã§ãã
ãã®ãããªèæ¯ããããããAlgol 68ãPASCALã¨ãã£ãç³»èã«å±ããåä»ããæã¤é«éè¨èªãå½æã·ã¹ãã ããã°ã©ãã³ã°ã®åéã§è±éããã¨ã¯ããã¾ããã§ããããã®ããã1980å¹´ã«Adaã¨ããå½¢ã§ã¢ã¡ãªã«ã®è»äºè¦æ ¼ã«æ¡ç¨ããããã¨ã¯ãå½æã®ã³ã³ãã¥ã¼ã¿æ¥çã«å¤§ããªé©ãããã£ã¦è¿ãããããã¨ã«ãªãã¾ããã©ã®ãããè°è«ãå¼ãã ã®ãã¨ããã¨ãããã¼ã»ãã¼ã¢ *1 ããã¥ã¼ãªã³ã°è³ã®è¨å¿µè¬æ¼ã§åæãã§ä¿¡é ¼æ§ã«ã¤ãã¦çåãåããçºè¨ãããã»ã©ã§ãã [3]ãå®å®éçºãè»äºç£æ¥ãªã©ã®åéã§è¤éãªæ©æ¢°å¶å¾¡ã®ããã«ã³ã³ãã¥ã¼ã¿ãçµã¿è¾¼ã¿ã¨ããå½¢ã§ãã®é©ç¨ã®å ´ãåºãããã¨ã«ãªãã¨ãç¾å¨ã®ããã«ãã©ãã·ã¥ã¡ã¢ãªãæè¼ãããã¨ã§ãã¡ã¼ã ã¦ã§ã¢ãã¤ã³ãµã¼ãããããã°ã©ãã³ã°ããã¨ãããããªæ¦å¿µããªãä¸ã§ *2 製é æç¹ã§ã®ã³ã¼ãããä¸åå¤æ´ã§ããªãçµã¿è¾¼ã¿åéã§ããã«å質ãé«ãããã¨ãããã¨ã課é¡ã¨ãªãã¾ãããã¢ã¡ãªã«å½é²ç·çã¯å½æ450種é¡ãã® (å¤ãã¯ã¢ã¼ããã¯ãã£ä¾åã§ãã¢ã¼ããã¯ãã£ã®ä¿å ¨ãçµäºããæç¹ã§æ¾æ£ããã) è¨èªãå µå¨ã®å¶å¾¡ã«ç¨ãããã¦ãããã¨ãææ ®ãã1975å¹´ã«High Order Language Working Group (é«éè¨èªã¯ã¼ãã³ã°ã°ã«ã¼ã) ãçµæãããããã«ã¨ã£ã¦ä»£ããæ°ããè¨èªã®æ¨¡ç´¢ãå§ãã¾ããããã¨ãã¨å½¼ã彼女ãã¯æ¢åã®è¨èªã®æ¡ç¨ãæ¤è¨ãã¦ãã¾ããããæçµçã«è¦ä»¶ãæºãããã®ããªãã¨å¤æããæ°è¦ã«è¨èªã®éçºãè¡ããã¨ã決æãã¾ãããã®çµæèªçããã®ãAdaã§ãããAdaã®ãããªé«éè¨èªãããã¸ãã¹ãã«ãªã£ãã¨ãããã¨ãããããè¨èªã®ç 究éçºãä¿ãã(ãã®æèã«ã¯Smalltalkãªã©ã®åçåä»ããªãã¸ã§ã¯ãæåè¨èªãå«ã¾ãã¾ã) æçµçã«Javaã®ãããªã¬ãã¼ã¸ã³ã¬ã¯ã·ã§ã³ãã©ã³ã¿ã¤ã ã«åããæ±ç¨ããã°ã©ãã³ã°è¨èªã®éçºã«ã¤ãªãã£ãã®ã§ã¯ãªããã¨ãå人çã«ã¯æãã¾ãã
ããã¦Go
1977å¹´ã¨ããæ代ãèããã¨ãããã§Cã«ã¤ãã¦ã®è¨åãå°ãããªãã®ã¯ä¸æè°ã«æãããããããã¾ãããããã¯ã¨ãããã®ãCã¯1978å¹´ã«ãã©ã¤ã¢ã³ã»ã«ã¼ããã³ã¨ããã¹ã»ãªããã¼ã«ããæ¸ç±ãåºçãããã¾ã§ã¯ãã£ã¨ãã«ç 究æã®ã¤ã³ãã¦ã¹ããã¸ã§ã¯ãã§ãããæ§ã ãªã½ããã¦ã§ã¢ããã¸ã§ã¯ãã§ä½¿ãããã¨ããã©ããããã§æçããã¦ããã¤ã³ãã¦ã¹ããã°ã©ãã³ã°è¨èªã§ãã£ãã¨ãããã¨ã§ããGoãGoogleã®ã¤ã³ãã¦ã¹ããã¸ã§ã¯ãã§ãã£ããã¨ãæ¯ãè¿ãã¨ã¨ã¦ã示åçã«æããã¨ãããããã¾ãã
ããã¯å¥ã®æ©ä¼ã«è¿°ã¹ããã¨ãããã®ã§ãããGoã®ã½ã¼ã¹ã³ã¼ãã¬ãã¸ããªã®æåã®ã³ãããã¯ãå®ã¯Goã§ã¯ãããCã§ãããã¾ããã
hello, world R=ken DELTA=7 (7 added, 0 deleted, 0 changed)
Brian Kernighan committed on Jul 19, 1972
æå³æ·±ãªã³ãããã§ãããããã¯Bã¨å¼ã°ããC以åã«ãã©ã¤ã¢ã³ã»ã«ã¼ããã³ã«ãã£ã¦éçºãããè¨èªã«ãã£ã¦æ¸ããã Hello World ã§ããBã¯æ¢åºã§ããBCPLã¨å¼ã°ããè¨èªã«å¼·ãã¤ã³ã¹ãã¤ã¢ãããè¨èªã§ãBCPLã®æã¤ç¹å¾´ã§ãããã¬ã¼ã¹ ({
}
) ã«ãã£ã¦ãããã¯ã表ç¾ããä»æ§ãªã©ã§å½±é¿ãåãã¦ãã¾ãã ((ãªããBCPLã®ã³ã¡ã³ã㯠//
ãåç½®ãããã¨ã§è¨è¿°ã§ãã¾ããããã®ä»æ§ã¯Cã«ã¯å¼ãç¶ããããC++ã§å¾©æ´»ãéãããã¨ã«ãªãã¾ããã))
ããã¦æ¬¡ã®ã³ãããã¯
ã§ãããããã¯åã³ãããã§Bã§æ¸ãããå 容ãCã«æ¸ãç´ãããã®ã¨ãªã£ã¦ãããGoãBããå§ã¾ããã«ç 究æã®ããã°ã©ãã³ã°è¨èªã®ãã¼ãã¹ãã©ããã®ç³»èã«ããã¨ãããã¨ãã¾ãã§ç¤ºåãããã®ãããªã¤ã¼ã¹ã¿ã¼ã¨ãã°ã¨ãªã£ã¦ãã¾ãã
Goã«ãããã話ãæ»ã£ã¦ããã¨ããã§ãã·ã¹ãã ããã°ã©ãã³ã°è¨èªã¨ã¯ãã·ã¹ãã ããã°ã©ãã³ã°ã¨ã¯ä½ãªã®ããã¨ããåãã«æ»ã£ã¦ã¿ããã¨ããã§ãããæ´å²ãæ¯ãè¿ã£ã¦å¾ãããç¥è¦ã¨ããã®ã¯ãããã«æ±ããããæ§è³ªã¨ããã®ã¯ã以ä¸ã«éç´ããããã ã¨ãããã¨ã§ãã
- æ½è±¡çãªãã¼ã¿æ§é ã®è¨è¿°å (Goã§ããstructãinterfaceãå«ãåã·ã¹ãã )
- æ§é åããã°ã©ãã³ã° (Goã§ããã¹ã¿ãã¯ãã¬ã¼ã ã«åºã¥ãé¢æ°ã¹ã³ã¼ã)
- ãã¼ãã¦ã§ã¢ã¢ã¼ããã¯ãã£ã«åºã¥ããæä½ã®è¨è¿°ãå¯è½ (Goã§ããè±å¯ãªããªããã£ãåãunsafe)
- ä¸è¨ãæ ä¿ãã¤ã¤ãã³ã³ãã¤ã©ãé«å¹çãªã³ã¼ããçæã§ãããã¨
ããããããä¸ã¤ãæ±ããããæ§è³ªèªä½ã¯ãæ代æ代ã®è¦è«ã«ãã£ã¦å¤åãããã¨ããç¹ã§ããããã§Goã¯æããã«ä¸è¨4ã¤ã®æ§è³ªãåããªãããCã«ã¯ãªã以ä¸ã®ç¹å¾´ãæã¤ãã¨ã«ãªãã¾ããã
- ç¹å®ã®æåã¨ã³ã³ã¼ãã£ã³ã°ãåæã¨ããæååå
- ã¹ã©ã¤ã¹
- ã¬ãã¼ã¸ã³ã¬ã¯ã·ã§ã³
- 並è¡å¦ç (goroutine) ããã³è£å©ããªããã£ã (channel)
ãããã®ãã¡ã®å¤ãã¯ã1990年代ãã2000年代ã®ã³ã³ãã¥ã¼ã¿æ¥çã«å¤§ããªè¶³è·¡ãæ®ãç¾å¨ãåºã使ãããJavaãããããPythonãã¯ããã¨ããå¤æ°ã®ã¹ã¯ãªããè¨èªã®å½±é¿ããªãã¨ã¯è¨ããªãç¹å¾´ã§ããç¹ã«ããèªç¥è² è·ãä½æ¸ããé«ãä½æ¥å¹çãéæã§ãããã¨ããå´é¢ã¯ã1960ã70年代ã¨æ¯ã¹é£èºçã«å®è£ é¢ç©ãããã®è¨ç®æ§è½ãåä¸ããåæã«ã³ã¹ããä½ä¸ãããã¨ã§ã³ã¢ãã£ãã£åãéæããé«æ§è½ãªå°åè¨ç®æ©ã®åå¨ãå¼·ãåæ ãããã®ã¨ããã¾ããã¤ã¾ããä½æ°´æºã¨é«æ°´æºã®ä¸¡ç«ã¨ããèªè»¢è»ç½®ãå ´ã®è°è«ã¯è¨ç®è³æºã«ä¹ããã£ãæ代ã®ç£ç©ã§ãããã ã¼ã¢ã®æ³åã¯è¨ãã¾ã§ããªã製é æè¡ã®é²æ©ãèªç¶ã¨æ¬æ¥ã®ãã·ã¹ãã ããã°ã©ãã³ã°è¨èªããæã ã«ããããããã¨ãããã¨ã§ãã
å°ååãä½ã³ã¹ãåããé«æ§è½ãªå°åè¨ç®æ©ãã¯ã¼ã¯ã¹ãã¼ã·ã§ã³ããã¼ã½ãã«ã³ã³ãã¥ã¼ã¿ã¨ããå¼ç§°ã§åºãä¸è¬ã«ãã¼ã±ãã£ã³ã°ãããããã«ãªããã·ã¹ãã ããã°ã©ãã³ã°ã«æ±ããããè¨èªçãã©ã³ã¿ã¤ã çè¦ç´ ã®ããæ¹ãå¤å®¹ããã¾ãããããã®ãã¨ã¯åæã«ã¢ããªã±ã¼ã·ã§ã³ããã°ã©ãã³ã°ã¨ã·ã¹ãã ããã°ã©ãã³ã°ã®å¢çãå¤åããã¦ããã¨å人çã«èãã¦ãã¾ããããã象徴çã«ç¾ãã¦ããã®ãã·ã§ã«ã®å®è£ ã§ãããã«ç 究æã§éçºãããBourne Shellã®æåã®ãã¼ã¸ã§ã³ã¯1979å¹´ã§ããããKorn Shellã¯1983å¹´ãBashã¯1989å¹´ãZ Shellã¯1990å¹´ã¨çå®ã«æ°ããä¸ä»£ãèªçãã¦ããããªãã¬ã¼ãã£ã³ã°ã·ã¹ãã ã®åãªãå¤å±¤ã¨ããå½¹å²ãè¶ ãã¦ãã·ã¹ãã ãªãã¬ã¼ã¿ã®çç£æ§ã¨ãã観ç¹ã§ã®é²åãéãã¦ãã¾ããããã®æå³ã§ãç¾ä»£çã«ãä½ã¬ãã«ã¢ã¯ã»ã¹ãã¨ãããã¨ã¯ãå¿ ããããã·ã³ã¢ã¼ããã¯ãã£ãç´æ¥è§¦ããã¨ã®ã§ãããããªéå»ã®æå³ã§ã®ä½ã¬ãã«ã®ã¿ãæå³ãããæ½è±¡å層ãçµç±ããªãã§ã·ã¹ãã ã³ã¼ã«ã®ãããªOSã®ããã°ã©ãã³ã°ã¤ã³ã¿ã¼ãã§ã¤ã¹ã«è§¦ãããã¨ããä½ã¬ãã«ã¨å¼ã¶ãã¨ã¯ããã大ããããã¨ã§ã¯ãªãã¨ãããã®ã§ã¯ãªãããã¨æã£ã¦ãã¾ãã
ãGoãªããããã·ã¹ãã ããã°ã©ãã³ã°ãã¯ã©ãã«æµãçãã
ä¸ã§è¿°ã¹ããã¨ãä¸è¨ã§è¨ãã°ãå©ç¨å¯è½ãªè¨ç®è³æºã®å¢å ã¨çç£æ§ã®è¿½æ±ããã·ã¹ãã å ¨ä½ã®è¤éæ§ãå¢ãããä½ã¬ãã«ãã®æ ãåºãã£ããã¨ã§ãããã«å«ã¾ãæ¦å¿µããããã¯ãä¸é¢çã§ã¯ãªããªã£ã¦ãã¾ã£ããã¨ãããã¨ãªã®ã§ããããã®ç¹ã«ã¤ãã¦ããã¨ãã·ã¹ãã ããã°ã©ãã³ã°ã«é¢ãã¦ãä½ãé¢å¿äºããä½ãç¥ã£ã¦ãããªããã°ãªããªãã®ããã¨ãããã¨ã1åã§æ¨ªæçã«è§£èª¬ããã®ã¯ã¨ã¦ãå°é£ãªãã¨ã¨ãªã£ã¦ãã¾ã£ãããã«æãã¾ãã1åã®æ è¡ã¬ã¤ãã§ä¸çæ è¡ãæ¡å ããã®ãç¡è¬ã§ãããã¨ã¨åæ§ãªããã«ã§ããã§ããããæ¬æ¸ã«å¯¾ãã¦ãã®ãããªæå¾ ãæ±ãã®ã¯ãå°ã çãéãã¨ãããã¨ã«ãªãã§ããããã§ã¯ä½ã§ãããã¨ããã¨ãèè ã§ããæ¸å·ãããããã®ãã·ã¹ãã ããã°ã©ãã³ã°ã®ä¸çã®æ¢è¨ªè¨ã¨æãã¦ãã¾ãããã¡ããã訪ãããããããªå°åã®è©³ç´°ã¯ãã¡ãã¨èª¿æ»ããã¦ããµã³ãã«ã³ã¼ãã«ããè£ä»ããããã¦ããç¹ã§ã¯ãéçã®ãããªæ è¡è¨ã¨ã¯ç°ãªãã®ã§ããã
ããæ¬æ¸ãæã«åãæ©ä¼ãããã¾ããããæ è¡å ã®æ´å²ãæåã®èæ¯ãå¦ã¶ã¨ããèå³æ·±ããªãããã«ãã³ã³ãã¥ã¼ã¿ãµã¤ã¨ã³ã¹ã®æ´å²ãªã©ãé ã«å·¡ãããªããèªãã§ã¿ãã¨ãããé¢ç½ãèªããã¨æãã¾ããåç« ã§åãä¸ããå 容ã«ã¤ãã¦ãä»ã®è§£èª¬ãåç §ãæãä¸ããªãããç解ãæ·±ãã¤ã¤ããã³ãå³ããã®ããä¸è¬çãªæè¡æ¸ã«ã¯ãªã楽ãã¿æ¹ãã¨æã£ã¦ãã¾ãã
[1] van der Poel, W. L.; Maarssen, L. A., eds. (27â31 August 1973). Machine oriented higher level languages. IFIP Working Conference on Machine Oriented Higher Level Languages (MOHL). DOI: 10.1002/spe.4380070115
[2] Brender, Ronald F. The BLISS programming language: a history. Softw. Pract. Exper. 2002; 32:955â981. DOI: 10.1002/spe.470
[3] Hoare, C. A. R. The Emperor's Old Clothes. Communications of the ACM; Vol. 24 Issue 2. DOI: 10.1145/358549.358561
*1:C.A.R. Hoareã¯Goã®ä¸¦è¡å¦çã®ã»ãã³ãã£ã¯ã¹ã®ç¤ã¨ãªã£ã¦ããCSPãçºæãã人ç©ã§ããç®èãªãã¨ã«ã¯ãAdaã®ä»æ§ã«ã¯CSPã®å½±é¿ãåããrendezvousã¨å¼ã°ããããªããã£ããå«ã¾ãã¦ãã¾ãããªãããã®æ¹å¤ã«ã¤ãã¦ãã¼ã¢ã¯ã®ã¡ã«è¬ç½ªãã¦ãã¾ããé¢ä¿ãªããã©nullåç §ãçºæãããã¨ã«ã¤ãã¦ãè¬ç½ªãã¦ããããããããã
*2:ã¡ãªã¿ã«EPROMãçºæãããã®ã¯1971å¹´ã§ãã
Goã®ãã®ã³ã°ã©ã¤ãã©ãª 2021å¹´å¬
ãã®è¨äºã¯PySpa Advent Calendar 2021ã®14æ¥ç®ã®ã¨ã³ããªã¼ã¨ãã¦æ¸ããã¾ãããæ¨æ¥ã®ã¨ã³ããªã¼ã¯å·åé£åã§ã¦ãã¦ãå¼ããããçæ´» ã§ãããã¡ãªã¿ã«ç§ã70âã®å·å庫ãè³¼å ¥ãã¾ãããæ¬å½ã«ã©ã¤ããã§ã³ã¸ã³ã°ã§ããã
ç·è«: ãªããã°ãå¿ è¦ã
å¯è¦³æ¸¬æ§
ãã¨ãç®çã¯èªæã§ãããã®åä½ã¾ã§ãèªæãªã¢ããªã±ã¼ã·ã§ã³ã¨ãããã®ã¯ã»ã¼åå¨ãã¾ãããç¾å®ã®ä¸çã®ã¢ããªã±ã¼ã·ã§ã³ã¨ãããã®ã¯ãåä½ãã©ã¡ã¼ã¿ã ã£ããå®è¡ç°å¢ã ã£ãããèµ·åæç¹ã§ã®ãã¾ãã¾ãªè¦å ã«ãã£ã¦æåãå¤ãããã®ã ããã§ããããã¦ãããããã¢ããªã±ã¼ã·ã§ã³ã«ã¯ã©ã¤ããµã¤ã¯ã«ã¨ãããã®ãããã¾ããããã§ããã©ã¤ããµã¤ã¯ã«ã¯ãã¢ããªã±ã¼ã·ã§ã³ã®å¦çãå®è¡ãããã«ã¤ããã¢ããªã±ã¼ã·ã§ã³ã®å å¤ã¨ã®æ å ±ã®ããã¨ãã§çãã大å±çãªç¶æ ã®å¤åã®ãã¨ã§ããã¢ããªã±ã¼ã·ã§ã³ã並è¡å¦çãè¡ããããªãã®ã§ããã°ãåã ã®ä¸¦è¡å¦çã®åä½ã«ãã©ã¤ããµã¤ã¯ã«ããããã¨ã§ããããã¢ããªã±ã¼ã·ã§ã³ã¯ããåç¬ã§è¤éãªç³»ã§ããã¨ãããã¨ã§ãã
ã¾ããç¾å®ã®ä¸çã«ããã¦ã¯ãåä¸ã®ã½ããã¦ã§ã¢ã§èªå·±å®çµããã¨ãããã¨ãé常ã«ã¾ããªãã¨ã§ããã©ããªã«åç´ãªã¢ããªã±ã¼ã·ã§ã³ã§ãã£ã¦ããOSã«ã¼ãã«ã¨ããç°ãªãã½ããã¦ã§ã¢ã¨ã®éã§ã·ã¹ãã ã³ã¼ã«ãªã©ã®ä»çµã¿ãç¨ãã³ãã¥ãã±ã¼ã·ã§ã³ãè¡ããã¨ã§ãã®ç®çãæãããã¨ã«ãªãã¾ããã¾ããç¾ä»£çãªã¢ããªã±ã¼ã·ã§ã³ã¯ããããã¯ã¼ã¯ãç¨ãã¦ä»ã®ã¢ããªã±ã¼ã·ã§ã³ã¨éä¿¡ãè¡ããã¨ããã°ãã°ããã¾ãããã®ãããªä¸çã§ã¯ãç³»ã®å¢çãåä¸ã®ã¢ããªã±ã¼ã·ã§ã³ãå«ãã ãã«çãã¦ãããã¨ã¯å°é£ã¨ãªãã¾ããããã¦ãè¤æ°ã®ã½ããã¦ã§ã¢ãå«ãç³»ã§ã¯ããããã¯ã¼ã¯çè«ãæã¡åºãã¾ã§ããªããè¤éæ§ãé£èºçã«å¢å¤§ãããã¨ã¯æããã§ãã
ããããè¤éãªç³»ã«ããã¦ããã°ãã°ç§ãã¡ã¯ã¢ããªã±ã¼ã·ã§ã³ã®äºæããªãåãã«ééãããã¨ãããã¾ããäºæããªãåãã¯ãã¢ããªã±ã¼ã·ã§ã³å é¨ã®ä¸å ·åã«ãããã®ããããã¾ããããå¤é¨ã®ä¸å ·åãçç±ãªã®ããããã¾ãããéãããæéã®ä¸ã§ãã®åå ãåãåãããã«ã¯ãã¢ããªã±ã¼ã·ã§ã³ãããæç¹ã§ã©ã®ãããªç¶æ ã§ãã£ãã®ããæç³»åçã«è¨é²ãã¦ãããã¨ãå¿ è¦ã«ãªãã¾ãã
è¨é²ãã対象ã®ç²åº¦ã¯ãã¾ãã¾ã§ããã¢ããªã±ã¼ã·ã§ã³åä½ã§ãã£ãããã¢ããªã±ã¼ã·ã§ã³ãæ§æããã¢ã¸ã¥ã¼ã«ãã³ã³ãã¼ãã³ãã§ãã£ãããé¢æ°ã®ã³ã¼ã«ã°ã©ãã§ãã£ãããã¯ãã¾ããããã®ä¸ã«æ¨ªæçã«æ¨ªãããé¢å¿äºã§ãã£ããããã§ããããã¾ããè¨é²ãã対象ããæ°å¤ãæåæ å ±ããã¤ããªåã§ãã£ãããã¾ããããããã¯ã©ã¤ããµã¤ã¯ã«ãæ§æããè¦ç´ ã®æç³»åçãªåå¾é¢ä¿ã表ããæ½è±¡çãªãã®ããããã¾ããã
ç¾ä»£ã§ã¯ããããã種ã ã®æç³»åçãªè¨é²ãéç¨ã§æ±ããããæèã«ããã¦å 足ãã¦ãããã¨ãå¯è¦³æ¸¬æ§ã¨å¼ãã§ãã¾ãã
å¯è¦³æ¸¬æ§ã¨ãã°
ã¢ããªã±ã¼ã·ã§ã³ãåããç°å¢ãè¦æ¨¡ããæ±ãããããµã¼ãã¹ã¬ãã«ã®éãã«ãã£ã¦ãå¯è¦³æ¸¬æ§ã«æ±ããããè¦ä»¶ã¨ããã®ãå¤ããã¾ãããã®ä¸ã§ãä¸é¨ã®çµã¿è¾¼ã¿ã·ã¹ãã ã®ãããªæ¥µç«¯ã«ãªã½ã¼ã¹ã®å¶éãããç°å¢ãé¤ããããããç¶æ³ã«ããã¦ãåé¡ã®åå ãææ¡ããã¨ãã観ç¹ã§æãåå§çãªæ¹æ³ã§ãããã¾ãéè¦ã¨ãªãã®ããã°ã§ããåè¿°ã®ããã«ã¢ããªã±ã¼ã·ã§ã³ä¸è¬ãæã¤æ§é ã«ãã£ã¦ä¸ããããæèãããã¾ãããã¢ããªã±ã¼ã·ã§ã³åºæã®æèã¯è¨è¨ã«ä¾åãããã®ã§ãããéçºè ãæ示çã«æ å ±ãåºåããããã«ã³ã¼ããè¨è¿°ãã¦ã¯ããã¦ææ¡ã§ãããã®ã¨ãªãã¾ããã¨ã¯ãããã®ã®ãä¸æ¹ã§ãã°ã«åºåããå 容ããã°ã®åºåç®æãªã©ã®è¨è¨ã¯ããã¸ã§ã¯ããéãã¦ä¸è²«ããããã¨ãé£ããã¨ããåé¡ããããããã°ã©ãã®å±äººçãªãã®ã«ãªãå¾åããããä¸è½ã¨ããããã§ã¯ããã¾ããããã®æå³ã§ã¯å®¢è¦³æ§ãæ ä¿ã§ããã¡ããªã¯ã¹ããã¬ã¼ã¹ã¨ãã£ãæ¦å¿µãéç«ã£ã¦ãããã¨ã§ãããã (ãããã®æ¦å¿µãããã§æ±ã£ã¦ãã¾ãã¨æ¬ç¨¿ã®ç¯å²ãè¶ ãã¦ãã¾ããããã¾ãå¥ã®æ©ä¼ã«è¿°ã¹ããã¨æãã¾ãã)
å¯è¦³æ¸¬æ§ã«ããã¦ãã°ãæ ãã®ã¯ãä¸è¬çã«ã¯è¨é²ã®å¯¾è±¡ã主ã«æåæ å ±ãå¤ãã®å ´åèªç¶è¨èªã®æã¨ãã¦è¡¨ç¾ããã¦ãããã®ã®æç³»åçãªéç´ã§ããæ¬ç¨¿ã§ã¯ç¹ã«æããå ¥ããªãéãããã®æå³ã§ãã°ã¨ããç¨èªãç¨ããåã ã®ã¤ãã³ããè¨é²ããå 容ã®ãã¨ããã°ã¨ã³ããªã¼ããã°ã¨ã³ããªã¼ã«è¨é²ãããæåæ å ±ããã°ã¡ãã»ã¼ã¸ã¨ãããã¨ã«ãã¾ãã
ãã°ã®æ©è½
ã©ããªã³ã°ããã©ã¼ããã¿ã¼ãæ§é åãã®ã³ã°
ãã°ã¯ããã°èªç©ºæ©ã«ããããã©ã¤ãã¬ã³ã¼ãã®ãããªãã®ã§ã(ããã©ã¼ãã³ã¹ãã»ãã¥ãªãã£ãªã©éæ©è½è¦ä»¶ä¸ã®è¦è«ã許ãç¯å²å ã§) éçãªè¦³ç¹ã§ã質çãªè¦³ç¹ã§ããå¯è½ãªéãæ å ±ãåæ¨é¸æãããããã«åºåããã¹ãã§ããããã¡ãã解æã®ããã«ãã°ãè¦è¿ããã¨ã«ãªã£ãéã«ã¯æ¤ç´¢ãçµãè¾¼ã¿ãè¡ããã¨ã«ãªãã¾ãããããããã容æã«ãããããªå·¥å¤«ããã°ã®ã¨ã³ããªã«å ãã¦ããå¿ è¦ãããã¾ãã
ãã®å·¥å¤«ã«ã¤ãã¦ã¯ãããã¤ãã®ãã©ã¯ãã£ã¹ãããã¾ããæãæåãªãã©ã¯ãã£ã¹ã¯ããã¾ã§ãããã¾ãããããã°ãåºåããã¢ããªã±ã¼ã·ã§ã³ããè¦ã¦ä¸»è¦³çãªæå»ããã°ã¨ã³ããªã¼ã«ä»å ããã¨ãããã®ã§ããç¾ä»£çã«ãã°ã¨ããã°ããã®ã©ãã«ãæ¬ ããã®ã¯ãªãã¨ãã£ã¦ããã§ãããã (ã¨ã¯ãããã·ã§ã«ãã¼ã¹ã®ã¢ããªã±ã¼ã·ã§ã³ã®å¤ãã§ãåºåã«ãã®ã©ãã«ãæ¬ ãã¦ãã¾ãã)
次ã«ããç¨ããããã®ã¯ããã°ã¬ãã«ã¨å¼ã°ããéè¦åº¦ããã°ã«ã©ããªã³ã°ããææ³ã§ãããã®ãã°ã¬ãã«ã®ç²åº¦ã¯ãã®ã³ã°ãã¬ã¼ã ã¯ã¼ã¯ã«ãã£ã¦æ¹éãç°ãªããã¨ãããã¾ãããæ¦ã次ã®ãããªã¬ãã«ãå®ç¾©ããã¦ãããã¨ãå¤ãã§ãããã
Fatal (è´å½ç)
ã¢ããªã±ã¼ã·ã§ã³ã®ç¶ç¶çãªåä½ãè ãããããªåé¡ãå ±åãããã°ã¨ã³ããªã¼ã«ä»å ãããéè¦åº¦ã
Error (ã¨ã©ã¼)
ã¢ããªã±ã¼ã·ã§ã³ãç¶ç¶ãã¦åä½ããããã¨ã¯å¯è½ã ããäºæããªãäºè±¡ãçºçãã¦ããæ¨ãå ±åãããã°ã¨ã³ããªã¼ã«ä»å ãããéè¦åº¦ã
Warning (è¦å)
äºæããªãäºè±¡ã§ãããã©ããã¯æèã«ä¾åããããè¨é²æç¹ã§ã®ç¶æ³ãã¢ããªã±ã¼ã·ã§ã³ã®è¨è¨ããå®ç¾©ãããå¹³æã®ãã®ã§ã¯ãªãæ¨ãå ±åãããã°ã¨ã³ããªã¼ã«ä»å ãããéè¦åº¦ã
Information (æ å ±)
ä¸è¨ã®ãããã§ããªããã¢ããªã±ã¼ã·ã§ã³ã®åä½ã«é¢ããæ å ±ã®ãã¡ãå°æ¥ã®è§£æã«æç¨ã§ãããããªãã®ãè¨é²ãããã°ã¨ã³ããªã¼ã«ä»å ãããéè¦åº¦ã
Debug (ãããã°)
主ã«éçºãä¸å ·åã®è§£æ±ºæã«ãããã°ãªã©ã®ç®çã§åä½ã追跡ããã®ã«å¿ è¦ãªæèæ å ±ãè¨é²ãããã°ã¨ã³ããªã¼ã«ä»å ãããéè¦åº¦ã
ä»ã«ããç¥ããã¦ããã©ããªã³ã°ã¯ããã°ãåºåããé¢æ°åãã½ã¼ã¹ã³ã¼ãã®ãã¡ã¤ã«åãåºåç®æã®è¡æ°ãªã©ãåºåããã¨ãããã®ã§ããããã«é¢ãã¦ã¯ãã¢ããªã±ã¼ã·ã§ã³ãè¨è¿°ããããã°ã©ãã³ã°è¨èªã®ä»æ§ãå®è¡ç°å¢ã«ä¾åãããããé ç®ã«ã¤ãã¦å ±éèªèãããã¨ããããã§ã¯ããã¾ããã
ããã¤ãæ±ç¨çãªã©ãã«ãç´¹ä»ãã¦ãã¾ããããããã¢ããªã±ã¼ã·ã§ã³ä¾åã§ã¯ãããã®ã®æç¨ãªã©ããªã³ã°ãããã¾ãããã¨ãã°ãããã¯ã¼ã¯ãµã¼ãã¼ã§ã¯æ¥ç¶å ã®IPã¢ãã¬ã¹ãè¨é²ãã¦ããã¨è¯ãã§ããããããããã¯ã¼ã¯ãµã¼ãã¼ã§ãHTTPãµã¼ãã§ãããªãã°HTTPã¡ã½ããããªã¯ã¨ã¹ãURIãè¨é²ãã¦ããã¨ãããã¨ãããè¡ããã¾ãããã®ããã«ãã©ãã«ã®ç¨®é¡ã¯æèã«ãã£ã¦ãã¾ãã¾ã§ããã解æã®éã«ã¯ã©ãã«ãæãããã«çµãè¾¼ã¿ãè¡ãªã£ã¦ãããã¨ã«ãªãã¾ãããããã°ã¨ã³ããªã¼ãè¨é²ããã¨ãã«ã¯ããä¸å®ã®å½¢å¼ã§æ ¼ç´ãããã¨ãæ±ãããã¾ãã
ãã°ãæåæ
å ±ã主ä½ã¨ãã¦ãããã¨ãããä¼çµ±çã«ã¯ãã°ãããã¹ããã¡ã¤ã«ã¨ãã¦åã¨ã³ããªãè¡æåã§è¡¨ç¾ãããã¡ã¤ã«ã«è¨é²ããããã¹ããªã¼ã ã«åºåãããã¨ãå¤ãããã¾ãããããããã¨ã§ãããã¹ããã¡ã¤ã«ã対象ã¨ããä¸è¬çãªã¦ã¼ãã£ãªãã£ããã¨ãã°grep
ãsed
ã¨ãã£ãã³ãã³ããæ¤ç´¢ãçµãè¾¼ã¿ã«æ´»ç¨ãããã¨ãã§ããã ãã§ãªããèªä½ã®ããã°ã©ã ã§ãã°ãå¦çãããã¨ã容æã¨ãªãããã§ãããã®ä¸ã§ãã°ã¡ãã»ã¼ã¸ã«å ããè¤æ°ã®ã©ãã«ãåãæ±ãã¨ãªãã¨ãåã¨ã³ããªãæååã¨ãã¦æå®ã®å½¢å¼ã«ãªã£ã¦ãããã¨ãæã¾ãããªã£ã¦ãã¾ããããã§ãå¤ãã®ãã®ã³ã°ãã¬ã¼ã ã¯ã¼ã¯ã¯ãã°ã¨ã³ããªã¼ãæå®ã®æ¸å¼ã«ã¦åºåããããã®ãã©ã¼ããã¿ã¼ã¨ãããã®ãåãã¦ãã¾ãã (ãªããå¼ç§°ã¯ãã¬ã¼ã ã¯ã¼ã¯ã«ãã£ã¦ç°ãªãã¾ãã)
ãã©ã¼ããã¿ã¼ã®ä»æ§ã¯ãã®ã³ã°ãã¬ã¼ã ã¯ã¼ã¯ã«ãã£ã¦å¤ããã¾ããããããã次ã®ãããªè¦ç´ ãåãã¦ãã¾ãã
- ã©ã®ããã«ãã°ã¨ã³ããªã¼ãæååã¨ãã¦æ´å½¢ãã¦åºåããããæ示ããããã®æåå
- ãã®æååå ã«åãè¾¼ãã§ãä»»æã®ä½ç½®ã«ãã°ã¡ãã»ã¼ã¸ãã©ãã«ãåºåãããã¨ã®ã§ãããã¬ã¤ã¹ãã«ãã¼æåå
ããã°ã©ãããã°ã¨ã³ããªã¼ã«å«ããããã«æ示çã«æå®ãã¦ããªãã©ãã«ãOOBãã¼ã¿ *1 ã¨ãã¦æååã«åãè¾¼ããããã«ãã¦ãããã©ã¼ããã¿ã¼ãããã¾ãã (é常ãæå»ã®ãããªã©ãã«ã¯æ示çã«å«ããã¨ãããã¨ã¯ããªãã¯ãã§ãããã¨ãã° log4j2
ã®ãããªãã¬ã¼ã¯ãæå»ã®ä»ã«ãç°å¢å¤æ°ãªã©å®è¡ç°å¢ã«é¢ããã©ãã«ãå«ãããã¨ãã§ããããã«ãã¦ãã¾ãã)
ãã©ã¼ããã¿ã¼ã¯ä¸»ã«äººéãç®è¦ãã¦ãå¤èªã§ãããããªåç´ãªæååãçæãããã¨ãç®çã¨ãã¦ãã¾ãããããããç¨ãã¦è¡¨ç¾ã§ããã©ãã«ã®ç¨®é¡ã¯ããå¤ãããã¾ãããè¤éãªæèã表ç¾ããå ´åã«ã¯ããã¤ã¦ã¯éãããã©ãã«ã®æ°ã®ä¸ã§è¤æ°ã®ãã°ã¨ã³ããªã¼ãåºåãããã¨ã§å¯¾å¦ãã¦ãã¾ããããç¾ä»£çãªéç¨ç°å¢ã«ããã¦ã¯ã¢ããªã±ã¼ã·ã§ã³ãã°ã¯ãã¼ã¿ã¤ã³ã¸ã§ã¹ãã§ã³ãä»ãã¦å³æçã«ãã°è§£æç¨ã®ãã©ãããã©ã¼ã ã«ã¹ããªã¼ãã³ã°ãããã¨ãå¢ãã¦ãã¦ããããããã人éãç´æ¥çºããã¨ããã¨ããããããã¤ã³ã¸ã§ã¹ãã§ã³ã容æãªå½¢å¼ã§åºåããã²ã¨ã¤ã®ãã°ã¨ã³ããªã¼ã«å¯è½ãªéãæèãè¾¼ããã¨ãããã¬ã³ãã¨ãªã£ã¦ãã¾ãããã®ãã¬ã³ãã®ä¸ã§çã¾ããã®ããæ§é åãã®ã³ã°ã¨ããèãæ¹ã§ãã
æ§é åãã®ã³ã°ã¨ããããã«ã¯ã対ã«ãªãæ¦å¿µã¨ãã¦éæ§é åããããã®ã³ã°ãããã¨ãããã¨ã§ããããã®éæ§é åããããã®ãä¼çµ±çãªãã©ã¼ããã¿ã¼ã®åºåããæååã¨ãããã¨ã«ãªãã¾ããæ§é åããããã®ã³ã°ã§ã¯ãããã°ã©ã çã«å¦çããããJSONãMessagePackãProtobufãCBORã®ãããªãã¼ã¿ã¢ãã«ã¨è¡¨ç¾å½¢å¼ã®ã»ãããåæã¨ãã¦ãæååã ãã§ã¯ãªããåæã¨ãªããã¼ã¿ã¢ãã«ã®è¨±ãç¯å²ã§ãã°ã¨ã³ããªã¼ãæ§æãããã¨ãã§ãã¾ãããã®ãããªç¶æ³ã§ã¯ãã©ãã«ã®æ°ã«è«ççãªå¶ç´ã¯ããã¾ãããããããã°ã©ãã¯ä»»æã«ãã°ã¨ã³ããªã¼ã«æèæ å ±ã¨ãã¦å¿ è¦ãªæ°ã®ã©ãã«ã追å ã§ããã®ã§ãã
ã¨ã³ããªã¼ãã¤ã³ãã¨è¨å®ã®ç²åº¦
ãã®ã³ã°ãã¬ã¼ã ã¯ã¼ã¯ã«ã¯ãã°ã®è¨é²ã«åä¸ã®ã¨ã³ããªã¼ãã¤ã³ã (ãã¬ã¼) ãæä¾ãããã®ã¨ããã¬ã¼ã ã¯ã¼ã¯ã®å©ç¨è ãè¤æ°ã®ã¨ã³ããªã¼ãã¤ã³ããåå¥ã®ãã¬ã¼ã¨ãã¦å®ç¾©ãã¦ãã¨ã³ããªã¼ãã¤ã³ããã¨ã«ãã©ã¼ããã¿ã¼ãªã©ã®è¨å®ãå¤ãããã¨ãã§ããããã«ãã¦ãããã®ã¨ãããã¾ãããã®ã¨ããå¤ãã®ãã¬ã¼ã ã¯ã¼ã¯ã§ã¯ããã°ã©ã çã«ãã¬ã¼ãè¨å®ã§ããããã«ãã¦ãã¾ãããå¤é¨ãã¡ã¤ã«ãªã©ãèªã¿è¾¼ãã§è¨å®ãããã¨ãã§ããããã«ãã¦ãããã®ãããã¾ãã
åç« ã§è¨é²å¯¾è±¡ã®ç²åº¦ãé¢ä¿æ§ã«ã¤ãã¦å°ã触ãã¾ããããäºå®å¤ãã®ã½ããã¦ã§ã¢ã¯ãã¢ã¸ã¥ã¼ã«ãã³ã³ãã¼ãã³ãã¨ãã£ãæ§é ãæã£ã¦ãã¾ãããã¨ãã°ãã¢ããªã±ã¼ã·ã§ã³ã¨ãããå©ç¨ããã©ã¤ãã©ãªã¨ã¯ãæçµçã«åãããã»ã¹ç©ºéã§åããã®ã®ãã³ã¼ãã®æ§æä¸ã¯å¥ã®ãã¡ã¤ã«ã ã£ãããããã°ã©ãã³ã°è¨èªãå®ç¾©ããããã±ã¼ã¸ãªã©ã®å¥ã®è«ççãªåºåã§ãã£ãããããã¨ãå¤ãã§ããããããã°ã©ãã³ã°è¨èªã«ãã£ã¦ã¯ãããããã¢ã¸ã¥ã¼ã«ãã³ã³ãã¼ãã³ãã®é¢ä¿æ§ãé層æ§é ãã¨ããã®ãããã¾ãããã®é層æ§é ããã¬ã¼ã¨å¯¾å¿ã¥ãã¦ããã¬ã¼ã®è¨å®ãé層æ§é ã®ä¸ããä¸ã«ä¼æ (propagate) ãããã¨ã®ã§ããããã«ãã¦ãããã®ãåå¨ãã¾ãããããé層ãã®ã³ã°ãªã©ã¨å¼ã¶ãã¨ãããã¾ãã
Goã®ãã®ã³ã°ã©ã¤ãã©ãª
- Zap以å
- Zap以å¾
- ã¤ã³ã¿ã¼ãã§ã¤ã¹ã®ã¿
Goã®ãã®ã³ã°ã©ã¤ãã©ãªã¯Goãèªçãã¦ãããã¾ãã¾ãªãã®ãä½ããã¦ãã¾ãããã大ããåãã¦Zap以åã¨Zap以å¾ã«åé¡ã§ãã¾ããZap以éã®ã©ã¤ãã©ãªã¯ã»ã¼ãã¹ã¦ãZapã®è¨è¨ãææ¬ã¨ãã¦ããã¨ãã£ã¦ããã§ããããZapããªãããã»ã©é©æ°çã§ãã£ããã¨ããã¨ãããã©ã¼ãã³ã¹ãAPIã®å©ä¾¿æ§ãç ç²ã«ããããããå¾æ¥åã®ã©ã¤ãã©ãªããããã£ã¨é«éã«åä½ããã«ãããããããæ§é åãã®ã³ã°ãªã©é²æ©çãªæ©è½ãå®è£ ã§ãã¦ããããã§ãã
Zap以åã®ãã®ã³ã°ã©ã¤ãã©ãª / ãã¬ã¼ã ã¯ã¼ã¯ã¯ä¸ã«æãã以å¤ã«ãæ°å¤ãåå¨ãã¾ãããã¡ã³ããã³ã¹ãåæ¢ãã¦ãããã®ãã¨ãã«Goã¢ã¸ã¥ã¼ã«ã«å¯¾å¿ãã¦ããªããã®ã¯ããã¦ããã§ã¯åãä¸ããªããã¨ã¨ãã¾ãã
åè¿°ã®äºåé¡ã¨ã¯å¥ã«ãå®è£
ã«ä¾åããªã (implementation agnosticãª) ãã¡ãµã¼ãã¨ãã¦ã®API (ä»ã®è¨èªããã¨ãã°Javaã§ããã¨ããã®slf4j
ã®ãããªã©ã¤ãã©ãªã§ã) ãæä¾ããã©ã¤ãã©ãªãããã¾ããããããã©ã¤ãã©ãªã§æãèåãªã®ãgo-logr/logr
ã§ããgo-logr/logr
ã®APIã使ã£ã¦ãã®ã³ã°ãå®æ½ãã¦ããã°ãLogrusãZapãZeroLogãå«ãè¤æ°ã®ãã®ã³ã°ãã¬ã¼ã ã¯ã¼ã¯ãããã¯ã¨ã³ãã¨ãã¦åãæ¿ãå¯è½ã¨ãªãã¾ããlogrã®ãããªã©ã¤ãã©ãªã¯ã¢ããªã±ã¼ã·ã§ã³ã®ä¸ã§ä½¿ãã¨ããããããã©ã¤ãã©ãªã®ä½è
ãããã®ä¸ã§ãã®ã³ã°ãå®æ½ããæ³å®ã§ããããã©ããç¹å®ã®ãã¬ã¼ã®å®è£
ã«ä¾åããã®ãé¿ããã©ã¤ãã©ãªã®å©ç¨è
ã®è£éã§å®è£
ãé¸ã¹ãããã«ãããã¨èãã¦ããæã«ç¹ã«æç¨ã§ãã
æ©è¦è¡¨
- | è¤æ°ã®ãã¬ã¼ã®ã¤ã³ã¹ã¿ã³ã¹å | ãã°ã¬ãã«ã«åºã¥ããã®ã³ã° | ãã©ã¼ããã¿ã®å¤æ´ | æ§é åãã®ã³ã° | JSONå½¢å¼ã§ã®åºå | ã¿ã¼ããã«ã«è²ä»ãã§åºå | ã¼ãã¢ãã±ã¼ã·ã§ã³ | ãµã³ããªã³ã° |
---|---|---|---|---|---|---|---|---|
æ¨æºã®log ããã±ã¼ã¸ |
âï¸ | ä¸é¨å¯ | ||||||
google/logger |
âï¸ | âï¸ | ä¸é¨å¯ | |||||
golang/glog |
âï¸ | |||||||
k8s.io/klog |
âï¸ | ããã©ã«ãã§ãä¸é¨å¯ã ããlogrçµç±ã§åºåãããã¨ã§å ¨é¢çã«å¯è½ | âï¸ | ï¸logrçµç±ã§åºåãããã¨ã§å¯è½ | logrçµç±ã§åºåãããã¨ã§å¯è½ | |||
Logrus | âï¸ | âï¸ | âï¸ | âï¸ | âï¸ | âï¸ | ||
apex/log |
âï¸ | âï¸ | âï¸ | âï¸ | âï¸ | âï¸ | ||
Zap | âï¸ | âï¸ | âï¸ | âï¸ | âï¸ | â (Windowsã§ä½¿ãã«ã¯å·¥å¤«ãå¿ è¦) | ï¸âï¸ | â |
ZeroLog | âï¸ | âï¸ | âï¸ | âï¸ | âï¸ | â | ï¸âï¸ | â |
RipZap | âï¸ | âï¸ | âï¸ | âï¸ | âï¸ | â (Windowsã§ä½¿ãã«ã¯å·¥å¤«ãå¿ è¦) | ï¸âï¸ | âï¸ |
æ¨æºã®log
ããã±ã¼ã¸
ãµã³ãã«ã³ã¼ã
package main import ( "log" "os" ) // åºå: // [my-app] 2021/12/12 15:13:02 /tmp/standard-log/test.go:12: Hello ä¸ç // [my-app] 2021/12/12 15:13:02 /tmp/standard-log/test.go:13: Helloå°ç // 2021/12/12 15:13:02.293092 test.go:17: [my-app] Hey ä¸ç // 2021/12/12 15:13:02.293095 test.go:18: [my-app] Heyå°ç func main() { // ããã©ã«ãã®ãã¬ã¼ãç¨ãããã°åºå // ãã©ã¼ãããã®å¤æ´ log.SetFlags(log.Llongfile | log.LUTC | log.LstdFlags) log.SetPrefix("[my-app] ") log.Println("Hello", "ä¸ç") log.Print("Hello", "å°ç") // ãã¬ã¼ã®ã¤ã³ã¹ã¿ã³ã¹ãçæ myLogger := log.New( os.Stdout, "[my-app] ", log.Ldate | log.Lmicroseconds | log.Lshortfile | log.LUTC | log.Lmsgprefix, ) myLogger.Println("Hey", "ä¸ç") myLogger.Print("Hey", "å°ç") }
ãããã£ã¼ã«
ã¬ãã¸ããª: go.googlesource.com
ããã¥ã¡ã³ã: pkg.go.dev
åã³ããã: 2009å¹´1æ27æ¥ (Goã®ãªãªã¼ã¹ã¯2009å¹´11æ)
å·çæç¹ã§ã®æçµãªãªã¼ã¹: (Goæ¬ä½ã®ãªãªã¼ã¹ã¨åã)
Goã®æ¨æºã©ã¤ãã©ãªã¨ãã¦æä¾ããã¦ãããã®ã³ã°ã©ã¤ãã©ãªã§ããä½è
ã¯rscãã¨ã©ã¹ã»ã³ãã¯ã¹æ°ã§ããæããã¦äººé¡ã«ãã°ã¬ãã«ã¯æ©ãããã¨ããææ³ãããã®ããããã¾ããããä»åç´¹ä»ãããã®ã³ã°ã©ã¤ãã©ãªã®ä¸ã§å¯ä¸ãã°ã¬ãã«ã«å¯¾å¿ãã¦ãã¾ãã ((å³å¯ã«ã¯Fatal()
ãPanic()
ããã°ã¬ãã«ã¨ããæ±ãã«ããã°3段éãããã¨ã«ãªã))ã
ã°ãã¼ãã«é¢æ°ãã¨ã³ããªã¼ãã¤ã³ãã¨ãã¦ä½¿ããã¨ã®ã§ããããã©ã«ãã®ãã¬ã¼ã¨ãNew()
é¢æ°ãéãã¦ã¤ã³ã¹ã¿ã³ã¹ãçæããåå¥ã«åºåãã©ã¼ããããªã©ã®è¨å®ãå¯è½ãªãã¡ã½ãããã¨ã³ããªã¼ãã¤ã³ãã¨ãªã£ã¦ãã*Logger
ã®APIã®äºæ¬ç«ã¦ã¨ãªã£ã¦ãã¾ãã
ãã©ã¼ããã¿ã¼ã®å®è£
ã¯åºå®ã§ãããSetFlags()
é¢æ° / ã¡ã½ãããéãã¦ããç¨åº¦ãã©ã¼ãããã®å¤æ´ãå¯è½ã§ããSetPrefix()
é¢æ° / ã¡ã½ããã¾ãã¯New()
é¢æ°ã®å¼æ°ã§ãã°ã¨ã³ããªã¼ã®ä¸ã«ä»»æã®åºå®æååãå«ãããã¨ãå¯è½ã§ãã
...()
㨠...ln()
ã®éãã¯ãã©ã¡ããå¼æ°ãè¤æ°æå®ãããã¨ãããã®å¼æ°ãæåååãããã®ãçµåãã¦åºåããã®ã§ãããããã§æååã¨æååã®éã«ã¹ãã¼ã¹ãå
¥ãã (...ln()
) ãå
¥ããªã (...()
) ã¨ããç¹ã§ããã¾ãã...f()
ãç¨ããã¨ãfmt.Printf()
ã¨åæ§ã®æ¸å¼æååãç¨ãã¦ãã°ã¡ãã»ã¼ã¸ãçµã¿ç«ã¦ããã¨ãå¯è½ã§ãã
Print...()
ã¨Fatal...()
Panic...()
ã®éãã¯ãPrint...()
ããã°ã¨ã³ããªã¼ãåºåå¾ãã ã¡ã«å¼ã³åºãå
ã«å¾©å¸°ããã®ã«å¯¾ãã¦ãFatal...()
ã¯ãã°ã¨ã³ããªã¼ãåºåå¾çµäºã¹ãã¼ã¿ã¹1ã§ããã»ã¹ãçµäºããPanic...()
ã¯ãã°ã¨ã³ããªã¼ãåºåå¾panicãçºçããã¦ããã»ã¹ãçµäºããã¨ããç¹ã§ãã
google/logger
ãµã³ãã«ã³ã¼ã
package main import ( "io" "log" "github.com/google/logger" ) // åºå: // ERROR: 2021/12/13 10:17:35 /tmp/google-log/test.go:15: ãããªãã§ããå®å®ã¤ã㤠// INFO : 2021/12/13 10:16:45 /tmp/google-log/test.go:15: Hello å®å® // INFO : 2021/12/13 19:16:45.237126 test.go:22: Hey å®å® // INFO : 2021/12/13 19:16:45.237153 test.go:28: Info verbosity set to 2 // INFO : 2021/12/13 19:16:45.237165 test.go:29: Heyä¸ç // INFO : 2021/12/13 19:16:45.237172 test.go:30: Heyå°ç func main() { // ããã©ã«ãã®ãã¬ã¼ãç¨ãããã°åºå // 第4å¼æ°ã¯ãã°ãã¡ã¤ã«ã®åºåå ã表ãio.Writerãªã®ã§ã // io.Discard (ioutil.Discard) ãæå®ããã¨æ¨æºåºåãã·ã¹ãã ãã¬ã¼ä»¥å¤ã«åºåãããªããªã logger.Init("my-app", true, false, io.Discard) // ãã©ã¼ãããã®å¤æ´ logger.SetFlags(log.Llongfile | log.LUTC | log.LstdFlags) logger.Error("ãããªãã§ãã", "å®å®", "ã¤ãã¤") logger.Infoln("Hello", "å®å®") logger.V(1).Info("Hello", "ä¸ç") logger.V(2).Info("Hello", "å°ç") // ãã¬ã¼ã®ã¤ã³ã¹ã¿ã³ã¹ãçæ myLogger := logger.Init("my-app", true, false, io.Discard) logger.SetFlags(log.Ldate | log.Lmicroseconds | log.Lshortfile | log.LUTC) myLogger.Infoln("Hey", "å®å®") // ããã©ã«ãã®ãã°ã¬ãã« (verbosity) ã¯0ã®ãããä¸ã®2ã¤ã¯è¡¨ç¤ºãããªã myLogger.V(1).Info("Hey", "ä¸ç") myLogger.V(2).Info("Hey", "å°ç") // ãã°ã¬ãã« (verbosity) ã1ã«è¨å® myLogger.SetLevel(2) myLogger.V(1).Info("Hey", "ä¸ç") myLogger.V(2).Info("Hey", "å°ç") }
ãããã£ã¼ã«
ã¬ãã¸ããª: GitHub
ããã¥ã¡ã³ã: pkg.go.dev
åã³ããã: 2016å¹´2æ11æ¥
å·çæç¹ã§ã®æçµãªãªã¼ã¹: 2021å¹´5æ8æ¥ (v1.1.1)
ã·ã³ãã«ã§ä¿å®çãªå®è£
ã¨Googleã®å
¬å¼GitHubã¬ãã¸ããªé
ä¸ã«ãããã¨ããã¨ã¦ãå¤ãã©ã¤ãã©ãªã®ããã«æãã¾ããããªãã¨åã³ãããã¯2016å¹´ã§ããæ´å²çã«è¦ãã¨golang/glog
ã®æ¹ãå
ã«ãªãªã¼ã¹ããã¦ããã«ããããããããã®ã©ã¤ãã©ãªãããã¦å®è£
ããã¢ããã¼ã·ã§ã³ã¯ããè¬ã«å
ã¾ãã¦ãã¾ã *2ã
APIã¯ããããæ¨æºã®log
ããã±ã¼ã¸ããªãã£ããã®ã¨ãªã£ã¦ãã¾ãããGoogleã®C++ãã®ã³ã°ã©ã¤ãã©ãªã§ããglogã¨åæ§ã®ã»ãã³ãã£ã¯ã¹ãæã£ããã°ã¬ãã«ã«å¯¾å¿ãã¦ããç¹ã§ããå®ç¨çã¨ããã¾ããglogã¨åæ§ã®ã»ãã³ãã£ã¯ã¹ã¨ããã®ã¯ããã®å¾ã«ç´¹ä»ããgolang/glog
ã¨ããããåããªã®ã§ããããã°ã¬ãã«ã ãã§ãã°ã®è©³ç´°åº¦ (verbosity) ãåºå¥ããã®ã§ã¯ãªãããã°ã®æ·±å»åº¦ (severity) ã¨è©³ç´°åº¦ (verbosity) ã¨ãæ¦å¿µä¸åºå¥ãã¦ããã¨ãããã®ã§ãããã°ã®æ·±å»åº¦ã¨ãã¦ã¯InfoãWarningãErrorãFatalã®4ã¤ãå®ç¾©ãã¦ãã¦ããã°ã®è©³ç´°åº¦ã¯æ·±å»åº¦ãInfoã®å ´åã«éãç¡æ®µéã§æå®ãããã¨ãã§ãã¾ããããããããã¨ã«ããã®ããã±ã¼ã¸ã®ããã°ã¬ãã«ãã¨ãã表ç¾ã¯å®éã«ã¯è©³ç´°åº¦ãæå³ãã¦ãã¾ãã®ã§çæãå¿
è¦ã§ããã¾ããæ·±å»åº¦ã«å¿ãã¦ãã°ã¨ã³ããªã®åºåãè¡ããè¡ããªãããå¶å¾¡ããã¨ãã£ããã¨ã¯ã§ãã¾ããã
ãã°ã¨ã³ããªã¼ã¯ã©ã®ãããªè¨å®ãè¡ã£ã¦ãå¿ ãæ¨æºåºåãæ¨æºã¨ã©ã¼åºåã«åºåããã¾ããã©ã¡ããé¸ã°ãããã¯ãã°ã®æ·±å»åº¦ã«ãããErrorãFatalã«é¢ãã¦ã¯æ¨æºã¨ã©ã¼åºåã«ãWarningãInfoã«ã¤ãã¦ã¯æ¨æºåºåã«æ¸ãããã«ãªã£ã¦ãã¾ãããããC++ã®glogã®ããªã·ã¼ããªãã£ãã®ãã®ã«ãªã£ã¦ãã¾ãã
log
ããã±ã¼ã¸ã¨åæ§Init()
ã¨ãããã¡ã¯ããªé¢æ°ããããåå¥ã®ãã¬ã¼ã®ã¤ã³ã¹ã¿ã³ã¹ãçæãããã¨ãã§ãâ¦ãã®ã§ãããè¨è¨ã度ãé£ããInit()
ã®ååã®å¼ã³åºãã¯ããã©ã«ãã®ãã¬ã¼ã®åæåãæå³ãã2åç®ä»¥éã®å¼ã³åºãã§ã¤ã³ã¹ã¿ã³ã¹ãçæã§ããããã«ãªãã¨ããä»æ§ã¨ãªã£ã¦ãã¾ããããã«ä¿¡ããããªããã¨ã«ã¯ãlog
ããã±ã¼ã¸ã«å®ç¾©ããããã®ã¨åããã©ã°ã§ãã©ã¼ããããå¤æ´ã§ããã®ã§ããããªãã¨ãã®ãã©ã¼ãããã¯ãã¬ã¼ã®ã¤ã³ã¹ã¿ã³ã¹ãã¨ã§ã¯ãªãã°ãã¼ãã«ã«ããå¤æ´ã§ããªãä»æ§ã¨ãªã£ã¦ãã¾ãã
ä»ã®ãã®ã³ã°ã©ã¤ãã©ãªã«ãªãç¹è²ã¨ãã¦ãOSã®ã·ã¹ãã ãã¬ã¼ (Windowsã§ããã°ã¤ãã³ããã°ãLinuxãªã©ã§ããã°syslog) ã«ããã°ã¨ã³ããªãåºåãããã¨ãã§ããã¨ããç¹ãããã¾ããããã©ã«ããã¬ã¼ã®ããã©ã«ãã®è¨å®ã§ã¯ãã·ã¹ãã ãã¬ã¼ã«ããã°ã¨ã³ããªãåºåããããã«ãªã£ã¦ãã¾ãã®ã§æ³¨æãã¦ãã ãããInit()
é¢æ°ã®ç¬¬3å¼æ°ã¯ systemLog bool
ã§ãããã true
ã«ããã¨ã·ã¹ãã ãã¬ã¼ã®åºåãæå¹ã«ãªãã false
ã«ããã¨ç¡å¹ã¨ãªãã¾ãã
Init()
é¢æ°ã®ç¬¬4å¼æ°ã«io.Writer
ã¤ã³ã¿ã¼ãã§ã¤ã¹ãæã£ããªãã¸ã§ã¯ããæå®ããã¨ãæ¨æº (ã¨ã©ã¼) åºåãã·ã¹ãã ãã¬ã¼ã«å ãã¦ããã®ãªãã¸ã§ã¯ãã®è¡¨ãåºåå
ã«ã (teeã³ãã³ãã®ããã«) ãã°ã¨ã³ããªãåºåã§ããããã«ãªã£ã¦ãã¾ãããããã«ãã¦ãæ¨æº (ã¨ã©ã¼) åºåã¸ã®åºåã¯æ¢ãããã¨ãã§ãã¾ããã
è¯ãã¨ããã»ç¹å¾´
- æ¨æºã®
log
ã¢ã¸ã¥ã¼ã«ä¸¦ã¿ã®ã·ã³ãã«ãã§ãã°ã¬ãã«ãä»å ããããã°ãæ±ããã¨ãã§ããã - ãã¬ã¼ã®è¨å®ãã³ãã³ãã©ã¤ã³ããåãåã£ã¦ãããªã«è¨å®ããã¦ããããããè¨å®ãè¡ãã³ã¼ããèªåã§æ¸ããªãã¦ãæ¸ãã
- å¥ã©ã¤ãã©ãªã®å©ããªã©ãåããã«ã·ã¹ãã ãã°ã«ããã°ãåºåã§ããã
- å ¬å¼ã£ã½ãé°å²æ°ã§å®å ¨å®å¿ã
è¯ããªãã¨ãã
- åºåå ã®ã³ã³ããã¼ã«ãããã»ã©æè»ã§ã¯ãªããããã¾ã§æ¨æºåºåã¸ã®åºåã¯å¼·å¶ã
- ãã©ã¼ããã¿ã¼ãåºå®ã§ä»»æã®åºåã«ã§ããªãã
- ä»»æã®ã©ããªã³ã°ãã§ãããå½ç¶æ§é åãã®ã³ã°ã«ã対å¿ãã¦ããªãã
- è¤æ°ã®è¨èªãç¨ãã¦ããããã¸ã§ã¯ãã®å ´åãä»ã®è¨èªã®ãã®ã³ã°ãã¬ã¼ã ã¯ã¼ã¯ã®ã»ãã³ãã£ã¯ã¹ã¨ç°ãªãé¨åãããã調æ´ãé£ãããããããªãã
golang/glog
ãµã³ãã«ã³ã¼ã
package main import ( "flag" "github.com/golang/glog" ) func init() { flag.Parse() } // go run test.go -logtostderr=true -v=2ãæå®ããã¨ãã®åºå: // I1213 22:38:05.617805 4014 test.go:17] Helloå°ç // I1213 22:38:05.617944 4014 test.go:18] Hello ä¸ç // I1213 22:38:05.617948 4014 test.go:19] Heyå°ç // I1213 22:38:05.617951 4014 test.go:20] Heyä¸ç // W1213 22:38:05.617954 4014 test.go:22] è¦å // E1213 22:38:05.617957 4014 test.go:23] ã¨ã©ã¼ // F1213 22:38:05.617959 4014 test.go:24] è´å½çã¨ã©ã¼ // exit status 255 func main() { defer glog.Flush() glog.V(1).Info("Hello", "å°ç") glog.V(2).Info("Hello", "ä¸ç") glog.Warning("è¦å") glog.Error("ã¨ã©ã¼") glog.Fatal("è´å½çã¨ã©ã¼") }
ãããã£ã¼ã«
ã¬ãã¸ããª: GitHub
ããã¥ã¡ã³ã: pkg.go.dev
åã³ããã: 2013å¹´7æ16æ¥
å·çæç¹ã§ã®æçµãªãªã¼ã¹: 2021å¹´8æ20æ¥ (v1.0.0) (ãããgo modulesã«å¯¾å¿ããåãªãªã¼ã¹)
Google謹製ã®C++ç¨ãã®ã³ã°ãã¬ã¼ã ã¯ã¼ã¯ã§ããglogã®Goçã¨ãããããªä½ç½®ã¥ãã§éçºãéå§ããããã®ã¨ã¿ããã¾ããæ¬å½ã®çç±ã¯ä¸æã§ãã
github.com/golang/
é
ä¸ã«ããã¾ãããããã¯go.googlesource.com
ã«ããGoogleã®ãããã¯ãã§ã¯ãªãGoã³ãã¥ããã£ã«ãã£ã¦éçºããã¦ããããã§ããã¨ã¯ãããããã»ãã¤ã¯æ°ãã¯ããã¨ããGoã®ã³ã¢ã¡ã³ãã¼ãéçºã«åå ãã¦ããã®ã§ãæºå
¬å¼ãããã®ä½ç½®ã¥ãã¨ãã£ã¦ãéè¨ã§ã¯ãªãã§ãããã
ãã¬ã¼ã®è¨å®ã¯C++ã®glogã¨åãããã«ã³ãã³ãã©ã¤ã³ããè¡ãããã«ãªã£ã¦ãã¾ãããªãã·ã§ã³åã¨æå³ãã»ã¼C++çã¨åãã§ãããã³ãã³ãã©ã¤ã³ãã©ã°ã«åç½®ããã-
ã®æ°ãC++ã§ã¯2ã¤ãªã®ã«å¯¾ãã¦Goçã¯1ã¤ã¨ãªã£ã¦ãããå®å
¨ãªäºææ§ãããã¨ã¯ããã¾ããããã°ã®è©³ç´°åº¦ã¯å®è¡æã«ãå¤æ´ãããã¨ã¯ã§ãã¾ãããæ®å¿µãªãã¨ã«ä»ã®è¨å®ã¯ã³ãã³ãã©ã¤ã³ä»¥å¤ããå¤æ´ã§ãã¾ããã
ãã°ã¬ãã«ã«ã¤ãã¦ã¯C++çã®glogã¨åæ§ã®ç¬ç¹ã®ããªã·ã¼ã«åºã¥ãã¦ãããåºå対象ã¨ãªããã°ã¨ã³ããªã¼ã®è©³ç´°åº¦ã-v=詳細度
ã®ããã«-v
ãªãã·ã§ã³ã§æå®å¯è½ã§ããC++çã®glogã§ã¯å®è£
ããã¦ããã«ããããããgoogle/logger
ã«ã¯ããã¦ããªãã£ããå¼ã³åºãç®æ (ã³ã¼ã«ãµã¤ã) ãã¨ã«ãã°ã®è©³ç´°åº¦ãæå®ããã¨ããæ©è½ã-vmodule
ãªãã·ã§ã³ãéãã¦å©ç¨å¯è½ã§ãã ãã®ãªãã·ã§ã³ã«ä¸ããå¤ã¯ããã¿ã¼ã³=詳細度
ã®å¯¾ã,
åºåãã§-vmodule=main=1,foo*=2
ã®ããã«æå®ãã¾ãããã¿ã¼ã³ã«æå®ããã®ã¯filepath.Match()
é¢æ°ã«æå®ã§ããæååã¨åããã®ã§ããã¿ã¼ã³ãããã¯åã½ã¼ã¹ãã¡ã¤ã«ã®ãã¹åã«å¯¾ãããã£ã¬ã¯ããªãå«ã¾ãªããã¡ã¤ã«åãã.go
ãåãé¤ãããã®ã«å¯¾ãã¦è¡ããã¾ãã
ããã©ã«ãã®ãã°åºåå
ã¯glogã¨åãããã«ãã³ãã©ãªãã£ã¬ã¯ããªå
ã®ãã¡ã¤ã«ã§ãos.TempDir()
ã§åå¾ãããã£ã¬ã¯ããªã¨ãªãã¾ãããã³ãã©ãªãã£ã¬ã¯ããªã§ã¯ãªãæ示çã«ãã£ã¬ã¯ããªãæå®ããã«ã¯ã³ãã³ãã©ã¤ã³ã«-log_dir
ãªãã·ã§ã³ã-log_dir=ãã£ã¬ã¯ããªå
ã®ããã«æå®ãã¾ãããã°ãã¡ã¤ã«ã¯æ·±å»åº¦å¥ã«çæãããæå®ã®æ¡ä»¶ã§ãã¼ãã¼ããã¾ãããã-log_dir
ãæå®ãã¦ããå ´åã§ãå½è©²ãã£ã¬ã¯ããªã«ãã¡ã¤ã«ã®çæãã§ããªãã£ãå ´åã¯ããã©ã«ãåæ§ã«ãã³ãã©ãªãã£ã¬ã¯ããªã使ãã¾ãã
ãã¡ã¤ã«ã«å ãã¦ãæ·±å»åº¦ãErrorã¾ãã¯Fatalã®å ´åã¯æ¨æºã¨ã©ã¼åºåã«ããã°ã¨ã³ããªã¼ãåºåããã¾ãããã ããæ·±å»åº¦ãWarningã¨Infoã®å ´åã¯google/logger
ã¨ç°ãªããåºåå
ããã¡ã¤ã«ã®ã¿ã¨ãªãã¾ãããã®åä½ã¯ -logtostderr=true
ã¾ã㯠-alsologtostderr=true
ãæå®ãããã¨ã§å¤æ´å¯è½ã§ãããæå®ããå ´åã¯Infoã®ãã°ã¨ã³ããªã¼ãæ¨æºåºåã§ã¯ãªããã¹ã¦æ¨æºã¨ã©ã¼åºåããåºåããã¾ãã
æ¨æºã®log
ããã±ã¼ã¸ãgoogle/logger
ã¨éã£ã¦ãè¤æ°ã®ãã¬ã¼ã®ã¤ã³ã¹ã¿ã³ã¹ãä½ããã¨ã¯ã§ãã¾ãããã°ãã¼ãã«ãªãã¬ã¼1ã¤ã®ã¿ãæ±ããã¨ãã§ãã¾ãã
CopyStandardLogTo()
é¢æ°ãå¼ã³åºããã¨ã§ãæ¨æºã®log
ããã±ã¼ã¸ã®åºåããã®ã©ã¤ãã©ãªçµç±ããã¦ãã¡ã¤ã«ã«åºåãããã¨ãã§ãã¾ãã
ä¸ã«æãã以å¤ã«ãã³ãã³ãã©ã¤ã³ãªãã·ã§ã³ãããã¤ãåå¨ãã¾ããã詳細ã¯ããã¥ã¡ã³ããåç §ãã¦ãã ããã
è¯ãã¨ããã»ç¹å¾´
- æ¨æºã®
log
ã¢ã¸ã¥ã¼ã«ä¸¦ã¿ã®ã·ã³ãã«ãã§ãã°ã¬ãã«ãä»å ããããã°ãæ±ããã¨ãã§ããã - ãã¬ã¼ã®è¨å®ãã³ãã³ãã©ã¤ã³ããåãåã£ã¦ãããªã«è¨å®ããã¦ããããããè¨å®ãè¡ãã³ã¼ããèªåã§æ¸ããªãã¦ãæ¸ãã
- å¼ã³åºãç®æ (ã³ã¼ã«ãµã¤ã) ãã¨ã«ãã°ã®è©³ç´°åº¦ãæå®ãããã¨ãã§ããã
- ããã©ã«ãã§ãã¡ã¤ã«ã«ãã¼ãã¼ããã°ãåºåãã¦ãããã
è¯ããªãã¨ãã
- ãã¬ã¼ã®è¨å®ãã³ãã³ãã©ã¤ã³ããè¨å®ãããã¨ããã
- æ¨æºã®
flag
ããã±ã¼ã¸ãç¨ãã¦ã³ãã³ãã©ã¤ã³ããã¼ã¹ãããããä»ã®ã©ã¤ãã©ãªã使ããã¨ãã§ããªãã init()
ã®ä¸ãªã©ã§flag.Parse()
ã®å¼ã³åºããå¿ è¦ã
- æ¨æºã®
- ããã©ã«ãã®ãã¬ã¼ã®åºåãæ¨æºåºåã§ã¯ãªããã³ãã©ãªãã£ã¬ã¯ããªã§ããã¨ããã
- ãã©ã¼ããã¿ã¼ãåºå®ã§ä»»æã®åºåã«ã§ããªãã
- ä»»æã®ã©ããªã³ã°ãã§ãããå½ç¶æ§é åãã®ã³ã°ã«ã対å¿ãã¦ããªãã
- è¤æ°ã®è¨èªãç¨ãã¦ããããã¸ã§ã¯ãã®å ´åãä»ã®è¨èªã®ãã®ã³ã°ãã¬ã¼ã ã¯ã¼ã¯ã®ã»ãã³ãã£ã¯ã¹ã¨ç°ãªãé¨åãããã調æ´ãé£ãããããããªãã
k8s.io/klog
ãµã³ãã«ã³ã¼ã
package main import ( "flag" "k8s.io/klog/v2" ) func init() { // initã§å¼ã³åºãã¦ãããã以ä¸ã¯æåã®ãã°ãæ¸ãåºãåã§ããã°ã©ãã§å®è¡ãã¦ããã flagset := flag.NewFlagSet("", flag.ContinueOnError) klog.InitFlags(flagset) // "-v=2" ã¨ãã㨠"Hey from å°ç" ã®ãã°ã¨ã³ããªã¼ã表示ãããã flagset.Parse([]string{"-v=1"}) } // åºå: // I1213 22:39:14.549553 4065 test.go:17] "Hello å°ç" type="greeting" target="planet" // I1213 22:39:14.549654 4065 test.go:18] "Hello from å°ç" type="greeting" sender="planet" // I1213 22:39:14.549661 4065 test.go:19] "Hey å°ç" type="greeting" target="planet" func main() { defer klog.Flush() klog.InfoS("Hello å°ç", "type", "greeting", "target", "planet") klog.InfoS("Hello from å°ç", "type", "greeting", "sender", "planet") klog.V(1).InfoS("Hey å°ç", "type", "greeting", "target", "planet") klog.V(2).InfoS("Hey from å°ç", "type", "greeting", "sender", "planet") }
ãããã£ã¼ã«
ã¬ãã¸ããª: GitHub
ããã¥ã¡ã³ã: pkg.go.dev
åã³ããã: 2018å¹´10æ26æ¥
å·çæç¹ã§ã®æçµãªãªã¼ã¹: 2021å¹´10æ22æ¥ (v2.30.0)
golang/glog
ã®ãã©ã¼ã¯ã§ãããã¤ã¦Kubernetesã§ã¯glogã使ã£ã¦ãã¾ãããããã®issueã§è°è«ãè¡ãããç¬èªã«ã¡ã³ããã³ã¹ãããã¨ã«ãªã£ãããã§ãã
Issueã§æãããã¦ããåé¡ã¨ã¯ä»¥ä¸ã®ãããªãã®ã§ãã
- Kubernetesã§ã¯
github.com/spf13/cobra
ãªã©ã®ã³ãã³ãã©ã¤ã³ãã¼ãµã¼ã使ã£ã¦ãããã¨ããããflag.Parse()
ãå¼ã³å¿ãããã¨ããã°ãã°ãããã¾ããå®è¡æã«è¨å®ãå¤æ´ããè¡ããªãã - ãã¡ã¤ã«ã«ãã°ãåºåãããã¨ããglogã®ããã©ã«ãã®æåã¯ãã©ã¤ãã©ãªã®ã¦ã¼ã¶ã¼ãé常æå¾ ãããã®ã§ã¯ãªãããã¡ã¤ã«ã«æ¸ãåºãããã®ã§ããã°æ示çã«è¨å®ãããã®ã¨èããã ããã
- ãããã°ãä½ããã¨ãã§ããªããã°glogã¯
os.Exit()
ãèªãã§ãã®æç¹ã§ããã»ã¹ãçµäºãã¦ãã¾ããããã¯ã¨ã¦ãå±éºãªãã¨ã ã - glogã¯æ¸ãåºããããã¡ã¤ã«ã管çãããããªãã®ã§ãlogrotateã®ãããªä»çµã¿ãå¥éãªããã°ã²ããããã¡ã¤ã«ãèç©ãã¦ãããã¨ã«ãªãã (ã¨ãã«ã³ã³ããã®ä¸ã§ã¯åé¡ã§ãã)
- glogã®åºåããã¹ãã§ããªãã
- åºåå ã®ãã£ã¬ã¯ããªã¯æå®ã§ããããç¹å®ã®ãã¡ã¤ã«ã«åºåãããã¨ãã§ããªãã
ãã®åé¡ã解æ¶ããããã«ãk8s.io/klog
ã§ã¯æ¬¡ã®ãããªæ¹åãè¡ããã¾ããã
- å®è¡æã«è¨å®ãå¤æ´ããããã®
InitFlags()
é¢æ°ãã¯ããã SetOutput() SetOutputBySeverity()LogToStderr()
é¢æ°ã®è¿½å ã (æªã æ®å¿µãªãã¨ã«å®è¡æã«è©³ç´°åº¦ãè¨å®ããé¢æ°ã¯ããã¾ããã) go-logr/logr
ãçµç±ãããã°ã®åºåã«å¯¾å¿ãSetLogger()
ãå¼ã³åºããã¨ã§è¨å®ãå¯è½ã§ãã- ãã°ã®åºåãã³ã³ããã¼ã«ããããã®
LogFilter
ã¤ã³ã¿ã¼ãã§ã¤ã¹ã¨SetLogFilter()
é¢æ°ã®è¿½å ã - æ§é åãã®ã³ã°ããµãã¼ããã
ErrorS()
InfoS()
é¢æ°ã®è¿½å ã (ãªããWarningS()
ã¯ããã¾ãããè¬ã) - ãã®ä»ã³ãã³ãã©ã¤ã³ãªãã·ã§ã³ã®æ¹åã (
-log_file
ã-log_file_max_size
ãªãã·ã§ã³ãªã©ã®è¿½å ã)
è¯ãã¨ããã»ç¹å¾´
golang/glog
ãã³ã³ããç°å¢ã§ä½¿ãä¸ã§ã®æ¬ ç¹ã解æ¶ããã¦ããã- ã³ãã³ãã©ã¤ã³ããã§ã¯ãªãããã°ã©ã çã«ãã¬ã¼ã®è¨å®ãã§ããã
golang/glog
ã¨APIã¬ãã«ã®äºææ§ãããã- æ§é åãã®ã³ã°ã«å¯¾å¿ãã¦ããã
go-logr/logr
ãçµç±ããåºåãå¯è½ã§ãèªç±ã«ãã®ã³ã°ã®å®è£ ãå·®ãæ¿ãããã¨ãã§ããã
è¯ããªãã¨ãã
- ããã¥ã¡ã³ãããªãã
- è¨å®æ¹æ³ããã¾ã ã«
flag
ããã±ã¼ã¸ã«å¼ããããã¦ããã - è¤æ°ã®è¨èªãç¨ãã¦ããããã¸ã§ã¯ãã®å ´åãä»ã®è¨èªã®ãã®ã³ã°ãã¬ã¼ã ã¯ã¼ã¯ã®ã»ãã³ãã£ã¯ã¹ã¨ç°ãªãé¨åãããã調æ´ãé£ãããããããªãã
Logrus
ãµã³ãã«ã³ã¼ã
package main import ( "github.com/sirupsen/logrus" ) // åºå: // INFO[2021-12-13T22:54:04+09:00] Helloå°ç // INFO[2021-12-13T22:54:04+09:00] Helloå°ç target=planet // INFO[2021-12-13T22:54:04+09:00] Helloå°ç target=planet // INFO[2021-12-13T22:54:04+09:00] Goodbyeå°ç target=planet // {"level":"info","msg":"Hello again å°ç","time":"2021-12-13T22:54:04+09:00"} func main() { // ããã¹ãå½¢å¼ã§åºåãã logrus.SetFormatter( &logrus.TextFormatter{ FullTimestamp: true, }, ) // ãã°ã¬ãã«ãDEBUG以ä¸ã®å ´åã«ã¯åºåãã logrus.SetLevel(logrus.DebugLevel) logrus.Info("Hello", "å°ç") logrus.WithFields( logrus.Fields{ "target": "planet", }, ).Info("Hello", "å°ç") contextual := logrus.WithFields( logrus.Fields{ "target": "planet", }, ) contextual.Info("Hello", "å°ç") contextual.Info("Goodbye", "å°ç") // JSONå½¢å¼ã§åºåãã logrus.SetFormatter(&logrus.JSONFormatter{}) logrus.Infoln("Hello", "again", "å°ç") }
ãããã£ã¼ã«
ã¬ãã¸ããª: GitHub
ããã¥ã¡ã³ã: pkg.go.dev
æåã®ã³ããã: 2013å¹´10æ17æ¥
å·çæç¹ã§ã®æçµãªãªã¼ã¹: 2021å¹´5æ9æ¥ (v1.8.1)
Goã®ãã®ã³ã°ã©ã¤ãã©ãªçã®ä¸ã§ã¯èèã§ãã¤ãã£ã¨ãåºã使ããããã¨ã«ãªã£ãã©ã¤ãã©ãªã§ããREADMEã«ããããã«ããã§ã«ãã®ã©ã¤ãã©ãªã¯ã¡ã³ããã³ã¹ã¢ã¼ãã«å ¥ã£ã¦ãã¦ãä½è èªèº«ãZeroLogãZapãApexã®å©ç¨ãææ¡ãã¦ãã¾ãã
æ©è½ã¨ãã¦ã¯ãã¤ãªãæ§é åãã®ã³ã°ã«å¯¾å¿ãã¦ãããããã©ã¼ããã¿ã¼ã®å®è£
ãå·®ãæ¿ãããã¨ãã§ããããã¾ãããã¿ã¼ããã«ã¸ã®åºåæã«ãã°ã¨ã³ããªã«è²ãã¤ããããããã¨ãã§ãã¾ããããã©ã«ãã§ã¯æ¨æºã¨ã©ã¼åºåã«ãã°ã¨ã³ããªã¼ãåºåããããã«ãªã£ã¦ãã¾ããã°ãã¼ãã«ãªããã©ã«ããã¬ã¼ã¨ã¯å¥ã«ããã¬ã¼ã®ã¤ã³ã¹ã¿ã³ã¹ãè¤æ°ä½ããã¨ãã§ãã¾ããç¹å¾´çãªãã®ã¨ãã¦ã¯ããã㯠(Hook
) ã¨ããä»çµã¿ããããããã使ãã¨ãã°ã¬ãã«ãã¨ã«ç°ãªãåºåå
ãæå®ãããããã°ã¨ã³ããªã¼ã«ãã£ã«ã¿ã¼ãæ½ããããããã¨ãã§ãã¾ãã
Zap以éã®ãã®ã³ã°ã©ã¤ãã©ãªã®ãã³ããã¼ã¯ã§ãããµã³ãããã¯ã¨ãã¦ååãæãããããããé ããææããããã¨ãããã¾ãããå®ç¨ä¸åé¡ã«ãªããã¨ã¯ã»ã¨ãã©ãªãã§ããããã¨ã¯ãããéãã«è¶ãããã¨ã¯ããã¾ããããããã¦ä»Logrusãé¸ã¶å¿ è¦ããªãã®ãäºå®ã§ãã
è¯ãã¨ããã»ç¹å¾´
- ãã使ããã¦ãã (ãã)ã
- ããã¥ã¡ã³ããããæ¸ããã¦ããã
- æ§é åãã®ã³ã°ã«å¯¾å¿ãã¦ããã
- JSONå½¢å¼ã®ãã©ã¼ããã¿ã¼ãã¤ãã¦ããã
- ä»ã®è¨èªã®ãã®ã³ã°ã©ã¤ãã©ãªã¨åæ§ã®ã»ãã³ãã£ã¯ã¹ãæã£ããã°ã¬ãã«ãæã£ã¦ããã
è¯ããªãã¨ãã
- (äºç´°ãªãã¨ã§ãã) ããã©ã«ãã®ãã©ã¼ããã¿ã¼ãæå»ã表示ããªãã¨ããã
- Zapãªã©ã®ã©ã¤ãã©ãªã¨æ¯è¼ãã¦é ãã
Apex
ãµã³ãã«ã³ã¼ã
package main import ( "github.com/apex/log" "github.com/apex/log/handlers/json" "github.com/apex/log/handlers/text" ) // åºå: // INFO[0000] Hello å°ç // INFO[0000] Hello å°ç target=planet // INFO[0000] Hello å°ç target=planet // INFO[0000] Goodbye å°ç target=planet // INFO[0000] span // INFO[0001] span duration=1002 // {"fields":{},"level":"info","timestamp":"2021-12-13T23:47:36.174844+09:00","message":"Hello again å°ç"} func main() { // ããã¹ãå½¢å¼ã§åºåãã log.SetHandler(text.Default) // ãã°ã¬ãã«ãDEBUG以ä¸ã®å ´åã«ã¯åºåãã log.SetLevel(log.DebugLevel) log.Info("Hello å°ç") log.WithField("target", "planet").Info("Hello å°ç") contextual := log.WithFields( log.Fields{ "target": "planet", }, ) contextual.Info("Hello å°ç") contextual.Info("Goodbye å°ç") func() { defer log.Trace("span").Stop(nil) time.Sleep(time.Second) }() // JSONå½¢å¼ã§åºåãã log.SetHandler(json.Default) log.Info("Hello again å°ç") }
ãããã£ã¼ã«
ã¬ãã¸ããª: GitHub
ããã¥ã¡ã³ã: pkg.go.dev Medium
æåã®ã³ããã: 2015å¹´12æ22æ¥
å·çæç¹ã§ã®æçµãªãªã¼ã¹: 2020å¹´8æ18æ¥ (v1.9.0)
Logrus以éãZap以åã«ç»å ´ããã©ã¤ãã©ãªã§ããAPIã¯Logrusã¨é常ã«ããä¼¼ããã®ã¨ãªã£ã¦ãã¾ãããããã¤ãç°ãªãç¹å¾´ãããã¾ãã主ãªãã®ã¨ãã¦ã¯
- æ§é åãã°ãåºåããä¸ã§ããå¹ççãª
WithField()
ã¡ã½ããã - ãã®ã³ã°ã©ã¤ãã©ãªã®ä¸ãããã¬ã¼ã¹ãèæ
®ãã
Trace()
ã¡ã½ããã®æä¾ã
ãããã¾ãããã®ä»ã®ç¹å¾´ã¨ãã¦ãåºåå
ã®ããã¯ã¨ã³ããå¤æ´å¯è½ãªHandler
ã®å®è£
ãæãããã¾ããæ¨æºã§ElasticsearchãAmazon Kinesisç¨ã®ãã³ãã©ã¼ãæä¾ããã¦ãã¾ãã
æ®å¿µãªããLogrusåæ§ãä»ã¨ãªã£ã¦ã¯ç©æ¥µçã«é¸æããçç±ã¯ãªãããã«æãã¾ãã
è¯ãã¨ããã»ç¹å¾´
- Logrusã¨ããç¨åº¦APIã®äºææ§ãããã®ã§ãã®ã¾ã¾ç½®ãæããã§ããã
- ç°¡æçãªãã¬ã¼ã¹ã«å¯¾å¿ãã¦ããã
- æ¨æºã§ããã¤ãã®ãã³ãã©ã¼ãæä¾ããã¦ããã
è¯ããªãã¨ãã
- æ¨æºã®
log
ããã±ã¼ã¸ã¨ã®äºææ§ããªãã text
ãã³ãã©ã¼ã®å®è£ ãã²ã©ãWindowsã«æ£ãã対å¿ã§ãã¦ããªãã (cli
ãã³ãã©ã¼ã¯å¯¾å¿ãã¦ããã)text
ãã³ãã©ã¼ã®æå»ã®ãã©ã¼ããããå¤æ´ã§ããªãã
Zap
ãµã³ãã«ã³ã¼ã
package main import ( "go.uber.org/zap" "go.uber.org/zap/zapcore" ) // åºå: // {"severity":"INFO","timestamp":"2021-12-06T08:22:45.9488001+09:00","go.uber.org/zap/caller":"test.go:47","permanent":"value","type":"greeting","target":"planet"} // {"severity":"ERROR","timestamp":"2021-12-06T08:22:45.9488664+09:00","go.uber.org/zap/caller":"test.go:56","permanent":"value","type":"greeting","target":"planet","go.uber.org/zap/stacktrace":"main.main\n\t/home/moriyoshi/src/zap-test/test.go:56\nruntime.main\n\t/home/moriyoshi/opt/go-1.17.3/src/runtime/proc.go:255"} // {"severity":"FATAL","timestamp":"2021-12-06T08:22:45.9488874+09:00","go.uber.org/zap/caller":"zap/test.go:63","permanent":"value","type":"greeting","target":"planet","go.uber.org/zap/stacktrace":"main.main\n\t/home/moriyoshi/src/zap-test/test.go:63\nruntime.main\n\t/home/moriyoshi/opt/go-1.17.3/src/runtime/proc.go:255"} // exit status 1 func main() { // ã¯ã¤ãã¯ã«ä½¿ãã®ã§ããã° // logger := zap.NewDevelopmentConfig() // ãªã©ã¨ããã°ãã // æã§configããã«ãããå ´å logger, err := zap.Config{ Level: zap.NewAtomicLevelAt(zap.DebugLevel), Development: true, Encoding: "json", EncoderConfig: zapcore.EncoderConfig{ TimeKey: "timestamp", LevelKey: "severity", NameKey: "go.uber.org/zap/logger", CallerKey: "go.uber.org/zap/caller", FunctionKey: zapcore.OmitKey, StacktraceKey: "go.uber.org/zap/stacktrace", LineEnding: zapcore.DefaultLineEnding, EncodeLevel: zapcore.CapitalLevelEncoder, EncodeTime: zapcore.RFC3339NanoTimeEncoder, EncodeDuration: zapcore.SecondsDurationEncoder, EncodeCaller: zapcore.ShortCallerEncoder, }, OutputPaths: []string{"stderr"}, ErrorOutputPaths: []string{"stderr"}, }.Build( zap.AddCaller(), zap.Fields( zap.String("permanent", "value"), ), ) if err != nil { panic(err) } defer logger.Sync() logger.Info( "Hello å°ç", zap.String("type", "greeting"), zap.String("target", "planet"), ) sugaredLogger := logger.Sugar() // sugaredLoggerã¯å°ãã ãé ããè¨è¿°éã¯æ¸ã sugaredLogger.Errorw( "Hey å°ç", "type", "greeting", "target", "planet", ) // Fatalãå¼ã³åºãã¨ã¹ã¿ãã¯ãã¬ã¼ã¹ãåºåãã¦ããã»ã¹ã¯çµäºãã logger.Fatal( "Goodbye å°ç", zap.String("type", "greeting"), zap.String("target", "planet"), ) }
ãããã£ã¼ã«
ã¬ãã¸ããª: GitHub
ããã¥ã¡ã³ã: pkg.go.dev
æåã®ã³ããã: 2016å¹´2æ20æ¥
å·çæç¹ã§ã®æçµãªãªã¼ã¹: 2021å¹´9æ9æ¥
ãã®ã©ã¤ãã©ãªã®ç¹å¾´ã¯ããªãã¨ãã£ã¦ãéãã§ããã¡ã¢ãªã¢ãã±ã¼ã·ã§ã³ãæå°éã«æ¢ããããã«ç¬èªã«JSONã®ã¨ã³ã³ã¼ãã¼ãå®è£
ãããªã©ãã¦ãããã¤ãã®ã±ã¼ã¹ã§ã¯ã¼ãã¢ãã±ã¼ã·ã§ã³ãéæã§ãã¦ãã¾ãããã¬ã¼ã®å®è£
ã¨ãã¦ã¯ãè¨è¿°ã¯æä½éã«ãªããä½éãªSugaredLogger
ã¨ãè¨è¿°éã¯è¥å¹²å¢ãã¾ããé«éãªLogger
ãæä¾ããã¦ãã¾ããä»ã®ãã®ã³ã°ã©ã¤ãã©ãªã¨éããã°ãã¼ãã«ãªããã©ã«ããã¬ã¼ã¯æä¾ããã¦ãã¾ããããRedirectStdLog
é¢æ°ãå¼ã³åºããã¨ã§ãæ¨æºã®log
ããã±ã¼ã¸ã®ãã°ã¨ã³ããªã¼ãZapã«æµããã¨ãã§ãã¾ãã
ãã©ã¼ããã¿ã¼ã®è¨å®ã¯ãConfig
æ§é ä½ã«å¤ãè¨å®ãBuild()
ã¡ã½ãããå¼ã¶ãã¨ã«ãã£ã¦è¡ãã¾ããJSONå½¢å¼ãããã¹ãå½¢å¼ãªã©æ ¹æ¬çãªãã°å½¢å¼ãè¨å®ããã«ã¯Config.Encoding
ã«ã¨ã³ã³ã¼ãã¼åãæå®ããåã
ã®è¦ç´ ã®è¡¨ç¾å½¢å¼ãæå®ããã«ã¯Config.EncoderConfig
ãå¤æ´ãã¾ããæ¨æºã§ã¯Encoding
ã«æå®ã§ããã¨ã³ã³ã¼ãã¼åã¨ãã¦ã¯json
ã¨console
ã®2種é¡ãããã¾ãããå®å
¨ã«ã«ã¹ã¿ãã¤ãºããã¨ã³ã³ã¼ãã¼ã使ãããå ´åã¯Encoder
ã¤ã³ã¿ã¼ãã§ã¤ã¹ãå®è£
ãããªãã¸ã§ã¯ããè¿ãé¢æ°ãRegisterEncoder
ã§ç»é²ãããã¨ã§è¡ãã¾ãããã°ã¬ãã«ãæå»ã¨ãã£ãè¦ç´ ã®ã¨ã³ã³ã¼ãã¼ã¯ããããEncoderConfig
æ§é ä½ã®EncodeLevel
EncodeTime
ãå¤æ´ãããã¨ã§å¯è½ã§ãã
Logrusã¨ä¼¼ããããªããã¯æ©æ§ãããã以ä¸ã®ããã«ãã¦ããã¯é¢æ°ãç»é²ããã¨ãã°ã¨ã³ããªã¼ãæ¸ãè¾¼ã¾ããç´åã«ä½ããã®å¦çãå®è¡ãããã¨ãå¯è½ã§ããããããLogrusã¨éã£ã¦ãã°ã¨ã³ããªã¼ã表ãEntry
æ§é ä½ãã®ãã®ã«æãå ãããã¨ã¯ã§ãã¾ãããããã¥ã¡ã³ãã«ãããã¾ãããã¨ã³ããªã¼ã«æãå ããå ´åã«ã¯zapcore.Core
ãå®è£
ãã¦å·®ãæ¿ãããã¨ã«ãªãã¾ãã
// ãã°ã¬ãã«ãã¨ã«åºåæ°ãæ°ããä¾ var mu sync.Mutex count := make(map[zapcore.Level]int) newLogger := logger.WithOptions( // `zap.Hooks()`ã¯`Option`ã®ãã«ãã¼é¢æ°ãªã®ã§ã`Config.Build()`é¢æ°ã®å¼æ°ã«æ¸¡ãã¦ãããã§ã zap.Hooks( func(e zapcore.Entry) error { // ãã°ã®åºåã®é½åº¦å¼ã°ãã¾ã mu.Lock() count[e.Level] += 1 mu.Unlock() return nil }, ), )
ä¸è¨ä»¥å¤ã«å®è·µçãªæ©è½ã¨ãã¦ã¯æ¡ä»¶ãµã³ããªã³ã°ãæãããã¾ããæ¡ä»¶ãµã³ããªã³ã°ã¨ã¯ãä¸ããããæ¡ä»¶ãæºããå ´åã®ã¿ãã°ã¨ã³ããªã¼ã®åºåãè¡ãã¨ãããã®ã§ãé«é »åº¦ã«ãã°ã®æ¸ãåºããçºçãããã©ã¼ãã³ã¹ä¸å½±é¿ãåºããããªç¶æ³ã§æç¨ã§ãããµã³ããªã³ã°ã®è¨å®ã¯Config
æ§é ä½ã«è¡ãã¾ãã
logger, err := zap.Config{ Level: zap.NewAtomicLevelAt(zap.DebugLevel), Development: true, Encoding: "json", EncoderConfig: zapcore.EncoderConfig{...}, // ...ã®é¨åã¯çç¥ã表ãã¦ãã¾ã Sampling: &SamlingConfig{ Initial: 50, // æåã®50ã¨ã³ããªã¼ããã¹ã¦åºåããã Thereafter: 10, // 以éã¯10ã¨ã³ããªã¼ããã«åºåãã }, OutputPaths: []string{"stderr"}, ErrorOutputPaths: []string{"stderr"}, }.Build(...) // ...ã®é¨åã¯çç¥ã表ãã¦ãã¾ã
è¯ãã¨ããã»ç¹å¾´
- ã¨ã«ããéãã
- æ§é åãã®ã³ã°ãåãããè¦æ®ããAPIã¨ãªã£ã¦ããã
- ãã©ã¼ããã¿ã¼ã®ã«ã¹ã¿ãã¤ãºæ§ãé«ãã
- æ¡ä»¶ãµã³ããªã³ã°ã«å¯¾å¿ãã¦ããã
- ããã¥ã¡ã³ããããç¨åº¦å å®ãã¦ããã
è¯ããªãã¨ãã
- ããããªã»ããã®ãã¬ã¼ã®è¨å® (
NewExampleConfig()
NewDevelopmentConfig()
NewProductionConfig()
) ãç¨ããªãå ´åã¯Config
æ§é ä½ãå©ç¨è ãçµã¿ç«ã¦ãå¿ è¦ãããããé ç®ãå¤ãç ©éã§ããã - è²ä»ãã®åºåã®å®ç¾ãéã«ANSIã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ãåºãã ãã¨ãªã£ã¦ãããWindowsã«å¯¾å¿ãããå ´åã¯mattn/go-colorableãå©ç¨ããå¿ è¦ãããã
ZeroLog
ãµã³ãã«ã³ã¼ã
package main import ( "github.com/rs/zerolog/log" ) // åºå // {"level":"info","type":"greeting","target":"planet","time":"2021-12-06T20:27:36+09:00","message":"Hello å°ç"} // {"type":"greeting","target":"planet","time":"2021-12-06T20:27:36+09:00","message":"Hello å°ç"} // {"level":"fatal","time":"2021-12-06T20:27:36+09:00","message":"Goodbye å°ç"} // exit status 1 func main() { log.Info().Str( "type", "greeting", ).Str( "target", "planet", ).Msg( "Hello å°ç", ) ev := log.Log().Fields( []interface{}{ "type", "greeting", }, ) ev.Str("target", "planet").Msg("Hello å°ç") // Fatalãå¼ã³åºãã¨ã¹ã¿ãã¯ãã¬ã¼ã¹ãåºåãã¦ããã»ã¹ã¯çµäºãã log.Fatal().Msg("Goodbye å°ç") }
ãããã£ã¼ã«
ã¬ãã¸ããª: GitHub
ããã¥ã¡ã³ã: pkg.go.dev
æåã®ã³ããã: 2017å¹´5æ14æ¥
å·çæç¹ã§ã®æçµãªãªã¼ã¹: 2021å¹´11æ2æ¥ (v1.26.0) â»Twitterã§èª¤èªãææããã ãã¾ããããããã¨ããããã¾ããã
Zap以éã«éçºãããã©ã¤ãã©ãªã§æãå©ç¨ããã¦ãããã®ããã®ZeroLogã¨è¨ããã§ããããããZapã§ãããããªããã¨è¨ãããªãé åããã®ã©ã¤ãã©ãªã«ã¯ããã¾ããZapã¯æ©è½ãè±å¯ã§ããããã¬ã¼ã使ãå§ããã¾ã§ã«ããªãã®æç¶ããè¸ãå¿ è¦ãããã¾ãããZeroLogã¯Zapã»ã©ã®æ©è½ã¯åãã¦ãã¾ããããã»ã¨ãã©ã®ã¦ã¼ã¹ã±ã¼ã¹ã§å¿ è¦ååã¨æããããã£ã¨ã·ã³ãã«ãªAPIãæä¾ãã¦ãã¾ããZapã«ã¯ãªãã£ãã°ãã¼ãã«ã®ããã©ã«ããã¬ã¼ãæä¾ããã¦ãã¾ããHookããµã³ãã©ã¼ã¨ãã£ãæ©æ§ãããã¾ãã
Zapã¨å¤§ããææ³çã«ç°ãªãã®ã¯ããã°ã¨ã³ããªã¼ã®çµã¿ç«ã¦ã«å¯å¤å¼æ°ã®ä»£ããã«ã¡ã½ãããã§ã¤ã³ãç¨ããã¨ããã§ããGoã®è¨èªçãªç¹å¾´ãããã¡ã½ãããã§ã¤ã³ã¯ã¯å¯èªæ§ãä½ããªããã¡ã§ã¯ããã®ã§ããã®é¨åã¯ããªã好ã¿ãåãããã¨ããã§ãããã
äºæ ã¯åããã¾ããããä»ã®ãã®ã³ã°ã©ã¤ãã©ãªã¨éããCBORå½¢å¼ã§ã®åºåãè¡ãããã©ã¼ããã¿ã¼ãæ¨æºã§æä¾ããã¦ãã¾ãã
è¯ãã¨ããã»ç¹å¾´
- æ¨æºã®
log
ããã±ã¼ã¸ã¨ä¸é¨äºææ§ãããã - ããããéãã
- æ§é åãã®ã³ã°ãåãããè¦æ®ããAPIã¨ãªã£ã¦ããã
- ã¡ã½ãããã§ã¤ã³ã使ã£ã¦ãã°ã¨ã³ããªã¼ãçµã¿ç«ã¦ãã¨ããã
- 詳細ãªããã¥ã¡ã³ããä¸è¦ãªãããAPIãã·ã³ãã«ã
- ã°ãã¼ãã«ã®ããã©ã«ããã¬ã¼ãããã
- æ¡ä»¶ãµã³ããªã³ã°ã«å¯¾å¿ãã¦ããã
- Zapããããããããªã³ããå°ããã
- Debugã¬ãã«ã®ä¸ã®ãã°ã¬ãã«ã¨ãã¦Traceãå®ç¾©ããã¦ããã
è¯ããªãã¨ãã
- ãã©ã¼ããã¿ã¼ã®ã«ã¹ã¿ãã¤ãºæ§ãä½ãã
- ãã©ã¼ããã¿ã¼ä»¥å¤ã«ãç´°ããè¨å®ãZapã»ã©ã¯ã§ããªãã
- ã¡ã½ãããã§ã¤ã³ã使ãã¨ããã
RipZap
ãµã³ãã«ã³ã¼ã
package main import ( "github.com/skerkour/rz" "github.com/skerkour/rz/log" ) // åºå: // {"level":"info","type":"greeting","target":"planet","timestamp":"2021-12-06T11:42:11Z","message":"Hello å°ç"} // {"level":"info","type":"greeting","target":"planet","timestamp":"2021-12-06T11:42:11Z","message":"Hello å°ç"} func main() { log.Info( "Hello å°ç", rz.String("type", "greeting"), rz.String("target", "planet"), ) log.SetLogger( log.With( rz.Fields( rz.String("type", "greeting"), rz.String("target", "planet"), ), ), ) log.Info("Hello å°ç") }
ãããã£ã¼ã«
ã¬ãã¸ããª: GitHub
ããã¥ã¡ã³ã: pkg.go.dev
æåã®ã³ããã: 2018å¹´7æ24æ¥
å·çæç¹ã§ã®æçµãªãªã¼ã¹: 2021å¹´8æ11æ¥ (v1.0.1)
ãã¨ãã¨ä½è
ã¯å¿åæ§ã®é«ãæ´»åã bloom42 (a.k.a. z0mbie42) ã®ãã³ãã«ã§è¡ã£ã¦ãã¦ã github.com/bloom42/rz-go
ã¨ããã¬ãã¸ããªã§ãªãªã¼ã¹ãã¦ããã®ã§ãããããæãã諸äºæ
ããã£ããããæ¬åã§æ´»åããããã«ãªãããã®éã«GitHubã¢ã«ã¦ã³ããã¬ãã¸ããªã github.com/skerkour/rz
ã«ç§»åããã¨ããçµç·¯ãããã¾ãããªã®ã§ãç¾ç¶forkæ°ãstaræ°ãã¨ã¦ãå°ãªãã§ããããããªãã«ä½¿ããã¦ã¯ãã¾ãã
ZapãZeroLogåæ§Hookããµã³ãã©ã¼ã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ãåãã¦ãã¾ãã
è¯ãã¨ããã»ç¹å¾´
- Zapã¹ã¿ã¤ã«ã®ãã£ã¼ã«ãæå®æ¹æ³ãæ±ããªãããZeroLogã®ãããªã°ãã¼ãã«ã®ããã©ã«ããã¬ã¼ãæä¾ããã¦ãããããã¨ããåãæã
- ãã³ããã¼ã¯ãè¡ããã¦ãããZapãZeroLogã«å¹æµããé度ã§åä½ããã
- ãã©ã¼ããã¿ã¼ã®å·®ãæ¿ããå¯è½ã
è¯ããªãã¨ãã
github.com/bloom42/rz-go
ããã¬ãã¸ããªã®å¤æ´ãè¡ãããéã«ãã¼ã¸ã§ã³ã®ãªã»ãããè¡ããã¦ãã¾ããv2.6.1ãv1.0.0ã«ããã¨ããè®è¡ãè¡ãããã®ã§ããããªãgo get
(ãªãgo mod tidy
ãªã) ã§å ¥ããªããªã£ã¦ãã¾ã£ãã- consoleç¨ãã©ã¼ããã¿ã¼ãéã«ANSIã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ãåºåãã¦ããã®ã§Windowsã«å¯¾å¿ãããå ´åã¯mattn/go-colorableãå©ç¨ããå¿ è¦ãããã
go-logr/logr
ãµã³ãã«ã³ã¼ã
package main import ( "github.com/go-logr/logr" "github.com/go-logr/zapr" "github.com/go-logr/zerologr" zerolog_log "github.com/rs/zerolog/log" "go.uber.org/zap" ) // {"level":"debug","msg":"Hello å°ç","type":"greeting","target":"planet"} // {"level":"debug","v":1,"type":"greeting","target":"planet","time":"2021-12-06T21:21:31+09:00","message":"Hello å°ç"} // {"level":"trace","v":2,"type":"greeting","target":"lands","time":"2021-12-06T21:21:31+09:00","message":"Hello ä¸ç"} func main() { var log logr.Logger log = zapr.NewLogger(zap.NewExample()) log.V(1).Info( "Hello å°ç", "type", "greeting", "target", "planet", ) log.V(2).Info( "Hello ä¸ç", "type", "greeting", "target", "lands", ) log = zerologr.New(&zerolog_log.Logger) log.V(1).Info( "Hello å°ç", "type", "greeting", "target", "planet", ) log.V(2).Info( "Hello ä¸ç", "type", "greeting", "target", "lands", ) }
ãããã£ã¼ã«
ã¬ãã¸ããª: GitHub
ããã¥ã¡ã³ã: pkg.go.dev
æåã®ã³ããã: 2016å¹´8æ16æ¥
å·çæç¹ã§ã®æçµãªãªã¼ã¹: 2021å¹´12æ13æ¥
Kubernetesãªã©ã®ããã¸ã§ã¯ãã«ã³ã³ããªãã¥ã¼ããã¦ãããå·çç¾å¨Googleã«å¨ç±ãã¦ããTim Hockinæ°ã«ãã£ã¦ä½ãããå®è£
ä¸ç«ã®ããã®ã³ã°ã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ãè¦å®ããã©ã¤ãã©ãªã§ããå®éã«ãã°ãåºåããããã«ã¯ãæä¾ããã¦ããããã¯ã¨ã³ãã®å®è£
ãéã㦠logr.Logger
ãçæãã¦å©ç¨ãããã¨ã«ãªãã¾ãã (2021/12/15追è¨:ã³ã¡ã³ãæ¬ã«ããç´ç²ãªã¤ã³ã¿ã¼ãã§ã¤ã¹åã§ã¯ãªãæ¨ããæ示ããã ãã¾ããã®ã§ãæè¨ãä¿®æ£ãã¾ããã)
ãã°ã®ã»ãã³ãã£ã¯ã¹ã¯glogãå¼·ãåæ ãããã®ã«ãªã£ã¦ããããã°ã®æ·±å»åº¦ã¨è©³ç´°åº¦ãä¼´ã£ã¦ãã°ã¨ã³ããªã¼ãåºåããã¨ãããã®ã«ãªã£ã¦ãã¾ããã§ããããã®ããã«ããã¯ã¨ã³ãã¨ã®ã¤ã³ãã¼ãã³ã¹ãããã³ã°ãå¿ è¦ã¨ãªã£ã¦ãããããªã·ã¼ããããã¯ã¨ã³ããã¨ã«ã¾ã¡ã¾ã¡ãªã®ãããããã°ã¬ãã«ãã¼ã¹ã®ããã¯ã¨ã³ãå®è£ ã¨ã®å©ç¨ã«ã¯å¤å°ã®ä½¿ãã¥ãããããã¾ããèªä½ã®ã©ã¤ãã©ãªã®ä¸ã§ãã®ã³ã°ãè¡ããããglogã®ã»ãã³ãã£ã¯ã¹ã好ãã§ããã°ããã®ã©ã¤ãã©ãªã使ãã¹ãã§ãããã
è¯ãã¨ããã»ç¹å¾´
- ãã®ã³ã°ã©ã¤ãã©ãªã®å®è£ ã«å¯¾ãã¦ä¸ç«ãªã¤ã³ã¿ã¼ãã§ã¤ã¹ã使ã£ã¦æ§é åãã®ã³ã°ãå¯è½ã
è¯ããªãã¨ãã
- ããã¯ã¨ã³ãããã°ã¬ãã«ä»ãã®ãã®ã³ã°ã«å¯¾å¿ãã¦ãã¦ããã©ã¤ãã©ãªã«å¼·ãææ³ãåæ ããã¦ãããããããã³ã°ãèæ ®ããªããã°ãªããªãã
ã¾ã¨ã
ç¹ã«å¼·ãææ³ããªããã°klogãZap以éã®ãã®ã³ã°ã©ã¤ãã©ãªãé¸ãã§ããã®ããããããã¨æãã¾ããå人çã«ã¯RipZapãæè¿ã¯ä½¿ã£ã¦ãã¾ãã
ç¡å¹å¤ã®è©±â
å æ¥ãã®ãããªé§ã¨ã³ããªãæ¸ããã
ååã¦ããããã¹ããããã°ãã£ã¨é²ããã§ãããåé¡ã§ãããããããããã
ãªãnilãå¿ è¦ã ã£ãã®ã
ã¨ããç¹ã§çåãæããã³ã¡ã³ããæ£è¦ãããã®ã§ããã®ç¹ãè£ã£ã¦ããããã
ãã®ããã¸ã§ã¯ãã§ã¯GORMã¨ããORãããã¼çãªãã®ãå©ç¨ãã¦ããããã®ãããã¼ã使ãéãã«ããã¦ã¯ãã¢ãã«ã®ä¸ã§SQL null (NULL
) ãä¸ãããããã«ã©ã ã«å¯¾å¿ãããã£ã¼ã«ã㯠sql.NullString
ãç¨ãããå¤åããã®ãã¤ã³ã¿åã«ããå¿
è¦ãããã
type User struct { Id int Name sql.NullString }
ãããã¯
type User struct { Id int Name *string }
ã©ã¡ããæ¡ç¨ãã¹ããã¨ããç¹ã§ã¯è°è«ããããåã®ã»ãã³ãã£ã¯ã¹ã¨ãã観ç¹ã§ã¯ãSQLã®æåååã¯æ¯è¨èªã®æåååã¨ã¯æå³è«çã«éãããããã®ãªã®ã§ãåè
ã®ããã«å°ç¨ã®åããã¦ããã®ã妥å½ã¨è¨ãããä¸æ¹ã§ãORãããã¼ã¨ããããã«ã¯ããã¼ã¿ã¹ãã¢ã®è©³ç´°ãã§ããã ãã¢ãã«ã«é²åºããªãã»ããæã¾ããã¨ããèãæ¹ãããã件ã®ããã°ã©ã ã¯ãå¾è
ã®è¦³ç¹ã§ããã¤ã³ã¿ã使ã£ã¦åºæ¬åã®å¤åã® NULL
ã表ç¾ãã¦ããã®ã§ããã
encoding/json
㧠JSON ã®ãªãã¸ã§ã¯ã㨠struct
ã§è¡¨ç¾ãããã¢ãã«ã対å¿ä»ãããå ´åã«ãåããããªåé¡ãããã
null
ãæ¥ãªããã¼ã¸ã§ã³:
package main import ( "fmt" "encoding/json" "bytes" ) type User struct { Id int `json:"id"` Name string `json:"name"` } const jsonStr = ` { "users": [ { "id": 1, "name": "foo" } ] }` func main() { r := bytes.NewReader([]byte(jsonStr)) val := struct { Users []User `json:"users"` }{} err := json.NewDecoder(r).Decode(&val) if err != nil { panic("oops") } fmt.Printf("%v\n", val) }
https://play.golang.org/p/gVayB9HDinj
null
ã許容ãããã¼ã¸ã§ã³:
package main import ( "fmt" "encoding/json" "bytes" ) type User struct { Id int `json:"id"` *Name string `json:"name"` } const jsonStr = ` { "users": [ { "id": 1, "name": "foo" }, { "id": 1, "name": null } ] }` func main() { r := bytes.NewReader([]byte(jsonStr)) val := struct { Users []User `json:"users"` }{} err := json.NewDecoder(r).Decode(&val) if err != nil { panic("oops") } fmt.Printf("%s\n", *val.Users[0].Name) }
https://play.golang.org/p/bcKXLM8UoN1
encoding/json
ã®ãã¼ã·ã£ãªã³ã°ã§ããJSONã®æåååã表ç¾ããå°ç¨ã®åãç¨æãã¦ãã¦ãããã¨ã¯å¯è½ã ããããããããããªãã¦ããä¸è¨ã®ããã«å¤åã®ãã¤ã³ã¿ãç½®ãã¦ãããã¨ã§JSON nullã«å¯¾å¿ä»ãããã¨ãã§ããã
ãã¦ãããã¾ã§ã¯ããã¾ã§æ¯è¨èªã¨ä»æ¹è¨èªã®åæ¹ã«ãçµã¿è¾¼ã¿ã®å¤ã·ã¹ãã / åã·ã¹ãã ã«ããã¦ãç¡å¹å¤ã«ç¸å½ãããã®ãå®ç¾©ããã¦ããå ´åã«ãã©ã対å¿ä»ããè¡ããã¨ããè¦ç¹ã§èãã¦ããã
ããããã¢ããªã±ã¼ã·ã§ã³ã®è¨è¨ã¨ããæå³ã§ã¯ãã¾ãå¥ã®è¦³ç¹ããããSQLã§ãããã¨JSONã§ãããã¨ãæ¯è¨èªã®ãã¼ã¿æ§é ã¨ã®1-to-1ãããã³ã°ãåæã¨ãããªãã°ãããããã»ãã³ãã£ã¯ã¹ä¸ã®ä¸æ´åãåºããããªã¹ãã¼ãè¨è¨ãããªãã¨ãããã¨ãã®ã ãå
·ä½çã«è¨ãã°ãSQLã§ããã°NOT NULL
å¶ç´ãä»å ãã¹ãã§ãJSONã§ããã°ãnull
å¤ãæ¥ããããªä»æ§ã«ããªãã¨ãã£ãå
·åã§ããã
ç¡å¹å¤ã¨ä¸å£ã«è¨ã£ã¦ããç¡å¹ã§ãããã¨ã使ãæã«ãã£ã¦æ示ãããçµæã¨ãã¦ã®ç¡å¹å¤ã§ããã®ããå®è¡ç°å¢ã«ããã¦ãä½ããã®å°åºã®çµæã¨ãã¦çãããå¤ãå¾ãããªããã¨ããäºè±¡ãæã示ã表示ã¨ãã¦ã®ç¡å¹å¤ãªã®ããã®åºå¥ããããç¹ã«SQLã«é¢ãã¦ããã°ãå¤é¨çµåãªã©ã§ç¾ãããã¨ãããããããã«ãNULL
ã¯å¾è
ã®æå³åããå¼·ããä¸æ¹JSONã«é¢ãã¦ã¯ããããç±æ¥ããè¨èªã§ããJavaScriptã®ã»ãã³ãã£ã¯ã¹ãè¦ãå¿
è¦ãããããJavaScriptã¯åçåä»ãè¨èªã§ãããã§ã¯è¤åå (array
ãobject
) ã«ãããè¦ç´ åã«åæãç½®ãã¦ããªããã¨ã«ãããããè¦ç´ ãåãããå¤åãè¤æ°ã®åã§å¤éåãããã¨ãå¯è½ãªãããnull
èªä½ã¯object
åã®ç¡å¹å¤ã§ããã«ããããããã使ãæãæ±ç¨çã«ç¡å¹å¤ã表ãææ¨ã¨ãã¦å©ç¨å¯è½ã§ããä¸æ¹ãobject
åã®æä½ã§å¾è
ã表ç¾ãããã®ã¨ã㦠undefined
ã¨ããç¹å¥ãªçµã¿è¾¼ã¿åãç¨æããã¦ãããã¨ãããJSONã«ãããnull
ã®å½¹å²ã¯ãåè
ã示åãããã®ã¨ãªã£ã¦ããã
Goã«ç«ã¡è¿ã£ã¦ã¿ãã¨ãéçåä»ãè¨èªã§ããGoã«ããã¦ã¯nil
ã¯å¤åã¨ãã¦ç¡å¹å¤ã®åå¨ã許ãããããããã®å (ã¹ã©ã¤ã¹åããã¤ã³ã¿åãinterfaceå) ãã¨ã«åå¨ãããã®ã¨ãã¦ä½ç½®ã¥ãããã¦ãã *1ã
ãã®ããã«ãä»æ¹è¨èªã¨ãã¦åãä¸ãã¦ãã2ã¤ã«é¢ãã¦ã ãã§ããä½ã対å¦ãããã«ä¸æ´åãé¿ãããã¨ã¯ã§ããããã®ãããªè¦³ç¹ã«ãä¸çããã¨ãããã
(ãã¶ãç¶ã)
*1:ãã ããç°ãªãinterfaceåãç°ãªããã¤ã³ã¿åå士ã®é¢ä¿æ¼ç®ã¯å®ç¾©ããã¦ãã¦ãç°ãªãnilå士ã®åå¤é¢ä¿ãæç«ãããã¾ããJavaScriptã®nullå®æ°ã¨éããå®æ°ã¨ãã¦ã®nilã¯åãæãããæèã«ãã£ã¦åã決ã¾ãããã«ãªã£ã¦ãã
nilã欲ããããã¨è¨ã£ã¦ããã¿ã«ãã¤ã³ã¿ã使ãã¨ã²ã©ãç®ã«ãã話
ã¹ãã¼ããã©ã³ã¢ããªå´ã®å®è£ æ å½ã¨ãã¦å°ãé¢ãã£ã¦ããããβçã®ãµã¼ãã¹ã§ãå¥å¦ã ãæ¯è¼çã¯ãªãã£ã«ã«ãªåé¡ãçºçãã¦ããã
ãããã¡ãã»ã¼ã¸ãé¢ä¿ãªã人éã«å±ãã¨ãããã®ã§ãã£ãã
ãªãã¨ãªããã®åé¡ãæ å½ãããã¨ã«ãªã£ããã常ã«ç¶æ³ãåç¾ããããã§ã¯ãªããä»ã®ä»äºããã£ãã®ã§ãåé¡ã¸ã®è¦å½ãä»ããããªãã¾ã¾ãã°ããéããã¦ãã¾ã£ãã
ãã®ã¡ãã»ã¼ã¸ãéä¿¡ããé¨åã¯ãµã¼ããµã¤ãã®ã³ã¼ãã§ãGoã§æ¸ããã¦ããã
ãã®ã³ã¼ãã®ã¨ãã»ã³ã¹ãæ½åºããã¨ã以ä¸ã®ããã«ãªãã
package main import ( "fmt" "sync" ) type User struct { Id int Name string } type Mail struct { Title string UserId *int } func sendMail(mail Mail, wg *sync.WaitGroup) { fmt.Printf("Title=%s, UserId=%d\n", mail.Title, *mail.UserId) wg.Done() } func main() { users := []User{ User{Id: 1, Name: "AAA"}, User{Id: 2, Name: "BBB"}, } wg := &sync.WaitGroup {} for _, user := range users { mail := Mail{ Title: fmt.Sprintf("%s, check out our season offerings!", user.Name), UserId: &user.Id, } wg.Add(1) go sendMail(mail, wg) } wg.Wait() }
sendMail() ã«æ¸¡ãããå¼æ°ã§ããã¨ããã® Mail
ã®å¤ã¯ã«ã¼ãã®ä¸ã§é½åº¦ä½ããã¦ããã®ã§ä¸è¦ããããã«æããã®ã ããå®è¡ãã¦ã¿ãã¨ãæã¨ãã¦æ¬¡ã®ãããªçµæã«ãªãã®ã ã
Title=BBB, check out our season offerings!, UserId=2 Title=AAA, check out our season offerings!, UserId=2
(Goroutineã®yieldããã¿ã¤ãã³ã°ã«ãã£ã¦çµæãå¤ããã®ã§ãæå¾ å¤éãã«ãªããã¨ãããã)
ãã¡ãããæå¾ å¤ã¯
Title=BBB, check out our season offerings!, UserId=2 Title=AAA, check out our season offerings!, UserId=1
ã®ããã«ãã¿ã¤ãã«ã«å«ã¾ããã¦ã¼ã¶åã¨ã¦ã¼ã¶ã®idãä¸è´ãããã¨ã§ããã
ããªæãããâ¦!!!
åå ã¯ã Mail
ã® UserId
ã¨ãã¦ãã«ã¼ãå¤ã®ã¹ã³ã¼ãã§å®ç¾©ããã user
ã® Id
ã¡ã³ãã¸ã®ãã¤ã³ã¿ãä¸ãããç¶ããããã ã
ãã«ã¼ãå¤ãã¨æ¸ãã¨ããuser
ã¯foræããå¤ã®ã¹ã³ã¼ãã§æ±ããªãããã ããã«ã¼ãã®ä¸ã ããã¨ããããã³ããå
¥ãããã ããå®éã®ã¹ã³ã¼ãã®å
å®ã¯ããã ã
- foræã®å¤å´ã®ã¹ã³ã¼ã
- foræã®å®£è¨ã®ã¹ã³ã¼ã (
for ... := ...
ã®é¨å)- foræã®å
å´ã®ã¹ã³ã¼ã (
{
}
ã®ä¸)
- foræã®å
å´ã®ã¹ã³ã¼ã (
- foræã®å®£è¨ã®ã¹ã³ã¼ã (
ãã®ä¸éã®ã¹ã³ã¼ãã¯ãã¬ã¼ã¹ (ä¸æ¬å¼§) ã§å²ã¾ãã¦ããªãç¯å²ãªã®ã§æèãã¥ããã®ã ã
ãã¦ããã®ã³ã¼ãã¯åãæ¥ã以ä¸ã®ããã«æ¸ãæããã°ããã
package main import ( "fmt" "sync" ) type User struct { Id int Name string } type Mail struct { Title string UserId *int } func sendMail(mail Mail, wg *sync.WaitGroup) { fmt.Printf("Title=%s, UserId=%d\n", mail.Title, *mail.UserId) wg.Done() } func main() { users := []User{ User{Id: 1, Name: "AAA"}, User{Id: 2, Name: "BBB"}, } wg := &sync.WaitGroup {} for _, user := range users { userId = user.Id mail := Mail{ Title: fmt.Sprintf("%s, check out our season offerings!", user.Name), UserId: &userId, } wg.Add(1) go sendMail(mail, wg) } wg.Wait() }
æ¸ãæããã°ãããã¨ã¯æ¸ãããã®ã®ãããããã³ã¼ãã«ãã¹ããããªãã¨ããã®ãæ£ç´ãªã¨ããã ãããã
ãã¦ãã³ã¼ããã§äºæãã¬ç®ã«éã£ã話
èªåã®ç¥ããªãCJK Ideographã®ããªã¨ã¼ã·ã§ã³ãã¾ã ãã£ããã¨ã«æ¦æ ãã¦ãã pic.twitter.com/kUlyRLDDTM
— moriyoshit (@moriyoshit) March 9, 2017
ãªã©ã¨ãããã¤ã¼ããããã¨ãããæã£ãããåé¿ããã£ãã®ã§ã¾ã¨ãã¦ããã
ä¸è¨ã§ã¯ããã¾ãã«ãããªã¨ã¼ã·ã§ã³ããªã©ã¨æ¸ããããUnicodeã¨ãããæ±ãç°å¢ã«ããã¦ã¯ãããªã¨ã¼ã·ã§ã³ã¨ä¸å£ã«è¨ã£ã¦ã次ã®ãããªç¶æ³ãããã
- æå³è«çã«ç価ãªç°ãªãåå½¢ã®éå
- åãåå½¢ã§ç°ãªãã³ã¼ããã¤ã³ãã®éå
aã¯çµæ§ãªãã¿æ·±ãã¨æãã
a-1. ç°ãªãã³ã¼ããã¤ã³ãã«ããããç°ãªãåå½¢ãå²ãå½ã¦ããã¦ãããã®
ä¾:
- ãæ±ã(U+6771) âãä¸ã(U+4E1C)
- ãæã(U+6589) âãé½ã(U+9F4A)
- ãé«ã(U+9AD8) âãé«ã(U+9AD9)
a-2. åãã³ã¼ããã¤ã³ãã§ããã©ã³ãã«ãã£ã¦åå½¢ãç°ãªããã®
ä¾:
- ãã(MS Minchoã®U+9AA8) âãã (SimSunã®U+9AA8)
- ãã(EmojiOneã®U+1F600) âãã (Noto Color Emojiã®U+1F600)
a-3. åãã³ã¼ããã¤ã³ãã§ãç°ä½åã»ã¬ã¯ã¿ãªã©ã«ãã£ã¦åå½¢ãç¹å®ããããã®
ä¾:
- ãã(U+260E + VS16)âãã(U+260E + VS15)
- ãè¾»ó ã(äºç¹ããã«ãã U+8FBB + VS18) âãè¾»ó ã(ä¸ç¹ããã«ãã U+8FBB + VS17)
bã®ç¶æ³ã¨ãã¦ã¯ã
b-1. æå³è«çã«ãåãã ãæ¿æ²»çã»æ´å²ççµç·¯ã§éè¤ãã¦åé²ããã¦ãããã®
ä¾:
- ãAã(å ¨è§ã¢ã«ãã¡ãããã®AãFULLWIDTH LATIN CAPITAL LETTER A U+FF21)âãAã(ã¢ã«ãã¡ãããã®AãLATIN CAPITAL LETTER A U+0041)
- ã×ã(ããã©ã¤æåã®ã¢ã¬ã U+05D0)âãâµã(ã¢ã¬ãã·ã³ãã« U+2135) *1
b-2. æå³è«çã«ç°ãªã£ã¦ããããå æãããå¥åã«åé²ããã¦ãããã®
ä¾:
- ã西ã (WEST U+897F) âãâ»ã(CJK RADICAL WEST TWO U+2EC4)
ãã¦ããã¤ã¼ãããã®ã¯ãb-2 ã®ç¶æ³ã§ãããCJK Radicalsã¨ã¯ãé¨é¦ãã表ãæåã®ãã¨ã§ãæå³è«çã«ã¯åä¸ã®é¨é¦ã®ã¿ã§æ§æãããCJK Ideographã¨ã¯åºå¥ãããã
ããã®ä½ãæãããã£ããã¨ããã¨ãç¾å®ã« (ã¨ããã¤ã³ã¿ã¼ããããµã¼ãã¹ä¸ã§) ã¦ã¼ã¶ã¼ãä½æã®ä¸é¨ã«å ¥åããæåã¨ãã¦ãã®CJK Radicalsãåºç¾ããCP932ã«å¤æã§ããªãã¨ããäºæ¡ãçºçããããã ã
JISX0208ã¨JISX0213ã§ä¾ç¤ºåå½¢ãç°ãªããã¨ããWindowsã®ãã¼ã¸ã§ã³éã§ããã©ã³ãã®å·®ç°ãããããã°ãã°ããçã«ä¸ãããããè¾»ããªã©ã§ããæè¿ã®OSæ¨æºã®IMEãIVSã«ã対å¿ãã¦ãããã¨ãããåæ§ã®åé¡ãèµ·ãããããªäºæããããããããã
*1 両è ãæå³è«çã«ç価ãã©ãããã¨ããã®ã¯è°è«ã®ä½å°ãããããã¨ãã°ãRãã¨ãâãã¯æèã®åºå¥ããããããããåå½¢ãç°ãªã£ã¦ãããããªã®ã§ãããããããã§ã¯decomposed formãããããªãããåºæºã¨ãããã¨ã«ããã
mod_wozozo
(ãã®è¨äºã¯ãPyspaã¢ããã³ãã«ã¬ã³ãã¼ 2016ã®12/4ã®ã³ããããè£è¶³ããå½¢ã§æ¸ããã¾ããã)
ã¯ããã«
çæ§ãåç¥ã®ãã¨ã¨æãã¾ãããOSSã³ãã¥ããã£ã¼ã«ããã¦ãéçºè ãçµå©ããéã«ã¯ãæ°éã¨æ°å©¦ã«
ãªãªã¸ãã«âââââââââââ
ãè´åããã¨ããæ £ç¿ãããã¾ãã
ã¯ãããã¡ãã
ãªãªã¸ãã«Apacheã¢ã¸ã¥ã¼ã«
ã§ããã
ã¿ã¤ã ã©ã¤ã³
10/3
é£çµ¡æ¥ãªãã£ããçµå©ã§ããã£ã½ã
— ( áð) (@wozozo) October 3, 2016
ãã³ãã«wozozoã ããã£ã±ãOzãã¿ã§è¡ããããªãã ããã¨ãããã¨ã§ãOzã®Apacheã¢ã¸ã¥ã¼ã«ãå®è£ ãããã¨ã«ããã
12/4
11:00
èµ·åºãå ¨æ¥ã®äº¬é½ã§ã®æ«é²å®´åå ããã®å¸°å® ã§æãã®ã»ãç²ãã¦ããã8æèµ·åºäºå®ãå¤§å¹ ã«ãããã
11:30
鬼平ç¯ç§å¸³ã¹ãã·ã£ã«ãè¦å§ãã
13:40
鬼平ç¯ç§å¸³ã¹ãã·ã£ã«ãè¦çµãããããããã¢ããã³ãã«ã¬ã³ãã¼ã®ãã¿ä»è¾¼ã¿ãããã¨æããgithub.com:mozart/mozart2
ããã§ãã¯ã¢ã¦ã
13:45
ãã«ãã¤ã³ã¹ãã©ã¯ã·ã§ã³ãè¦ããã¨ãã¾ cmake ãªã©ãå
¥ãã¦ã¿ã¦ã cmake .
ãªã©ããã
13:50
cmake ãéããªããèªåçã« clang ã¨ã LLVM ã¨ãè½ã¨ãã¦ããã¨æ¸ãã¦ããã®ã ã... ä»æ¹ãªã OS (Ubuntu 15.04) ã®ããã±ã¼ã¸ãã LLVM ãå ¥ãã¦ãã«ãã試ã¿ããã¨ã«ã
14:00
OS ã®ããã±ã¼ã¸ã® clang ã LLVM ã§ã¯ããªããã¤ã³ã¹ãã¼ã«ããããã¡ã¤ã«ã®æ¬ æããããã«ããã§ããªããUbuntu 16.10 ã§ã¯ç´ã£ã¦ãããããªã®ã§ãdo-release-upgrade
ã試ã¿ãã
14:20
OS ã®ã¢ããã°ã¬ã¼ããå®äºããã®ã§ããã«ããéå§ããã
14:30
ãã«ãã«å¤±æããã®ã§ããããã調ã¹ã¦ã¿ãã¨ãã©ã¤ãã©ãªä»å±ã® cmake ãã¡ã¤ã«ã®çãããããããããã¨ãå¤æãã©ã®ãªãã·ã§ã³ãå¿ é ãªã®ãã調æ»ããã
14:40
ãªãã·ã§ã³ã®æå®ã解æã§ããããã«ããèµ°ãå§ãããæéãããããããªã®ã§ãé£äºã«åºãããã
15:00
é£äºããæ»ãããã«ãã¯ç¡äºå®äºãã¦ãããã©ã³ã¿ã¤ã ã®ãã¹ãããããããOz ã®è¨èªä»æ§ãªã©ã調ã¹å§ããã
15:15
å¤ããã¼ã¸ã§ã³ (Mozart1) ã®è³æããã³ãããã¦ãµã³ãã«ã³ã¼ããåãããã¨ã«æåã
15:30
æ¨æºåºåã«åºåããæ¹æ³ (System.show
) ãªã©ãå¦ã¶ã
16:00
ã½ã¼ã¹ã³ã¼ãã®æ§æãå¦ã³ã¯ãããã
17:00
VMã®ããã³ãã¨ã³ãã¨ãã¦Boostã«ãã©ãããã©ã¼ã ã®å·®ç°ãå¸åãããboosthost
ã¨ãããã®å¯¾ã«ãªã boostenv
ã¨ããã³ã³ãã¼ãã³ãããããã¨ããããããã®é¨åã§åãåºããã¨ã§Apacheã¢ã¸ã¥ã¼ã«ã«çµã¿è¾¼ãããã ã¨ããè¦è¾¼ã¿ãç«ã¦ãã
17:10
Apacheã¢ã¸ã¥ã¼ã«ã®ã²ãªå½¢ãæ¸ãå§ãããapxsã¯ãã®ã¾ã¾ä½¿ããªãã®ã§apxsããå¤æ°ã ãã¯ã¨ãªãã¦ãã¨ã¯Makefileã§ãããã¨ã«ããã
18:30
å¬ä¿ãããã
19:00
libtool ã« -module
ãªãã·ã§ã³ã渡ãã¦ã .so
ãçæã§ããªãåé¡ã®è¬ã解ããã (-rpath
ãªãã·ã§ã³ãå¿
è¦ã ã£ã)
19:30
ã²ãªå½¢ã«Mozart2ã®ã³ã¼ãã®ä¸é¨ãçµã¿è¾¼ãã å½¢ã§ã³ã³ãã¤ã«ãéããã¨ã«æåããã
ã ããMozart2ã®ãã«ãã·ã¹ãã ã§ãã«ããããã³ã³ããã¨ã³ã¹ã©ã¤ãã©ãª (æçµçãªãã¤ããªçæç©ã§ãã ozemulator ãçæããããã«ãã«ãã®éä¸ã§ä¾¿å®çã«ä½ãããã©ã¤ãã©ãª) ã¯ãPIC ã³ã¼ãã§ã¯ãªãã£ãã®ã§ãªã³ã¯ã§å¤±æãã¦ãã¾ãã
ä»æ¹ãªãã®ã§ CMAKE_CXX_FLAGS
ã« -fPIC
ã追å ãã形㧠Mozart2 ããã«ãããªãããã¨ã«ããã«ãã«æéããããã®ã§é£äºã«åºãããã
20:00
é£äºããæ»ããä½æ¥åéãããã«ãã«ãã«ã¯æåããã
Apacheã®configããå¾ãããå 容ãVMã®èµ·åãã©ã¡ã¼ã¿ã«å¤æããç°¡åãªãä»äºã®éå§ã
21:00
I/Oã¹ã¬ããã®æ±ãã«æ©ã¿å§ãããI/Oã¹ã¬ãããã²ã¨ã¾ãpost_config
ãã§ã¼ãºã§èµ·åããå½¢ã§å®è£
ã
22:00
handler
ã«VMãèµ·åãããã¨ããã¾ã§æ¥ããããVMãèµ·åããªãããããã°ãç¶ããã
23:40
ãã¯ã¾ãããããä½è¨ãªãã©ã¡ã¼ã¿ã渡ãã¦ãããã¨ãåå ã¨å¤æãä¿®æ£ãããªã¯ã¨ã¹ãURIã§æå®ãããããã¥ã¡ã³ãã«ã¼ãé ä¸ã®Mozart2ã®ãã¤ããªãèªã¿è¾¼ãã§å®è¡ãããã¨ã«æåããããããããã®æç¹ã§ã¯ãã¾ã ã¬ã¹ãã³ã¹ãæ¸ãåºããã¨ã¯ã§ãã¦ããªãã®ã§ãæ¨æºã¨ã©ã¼åºåã¸ã®å®è¡çµæã®åºåã§ç¢ºãããã®ã¿ã
24:00
Apacheã¨ã®ã¤ãªããã¿ãå§ãããæåã®é£é¢ã§ãããVMã®èµ·åæã«VMã«request_recã渡ãã¨ããé¨åã¸ã®å¯¾å¿ãéå§ããã
25:20
VMã®ãã©ã¡ã¼ã¿ã¨ãã¦æ¸¡ãã¦ããã®ã¯ãå¤æ¸¡ãã®VMIdentifier
VirtualMachineOptions
åã¨ã std::unique_ptr<std::string>
渡ãã®ã¢ããªã±ã¼ã·ã§ã³URLã®ã¿ã
std::string
ãç¶æ¿ããã¯ã©ã¹ãä½ããããã« request_rec
ãçªã£è¾¼ãã¨ããå¼·å¼ãªããæ¹ã§æåããã
25:30
Mozart2 ã®ãã«ãã¤ã³ããã·ã¼ã¸ã£ã®ä½ãæ¹ã調ã¹ããC++ã®ã¯ã©ã¹ã®å®è£ ã¨ãããããã«ãã·ã¹ãã ã®ãã¼ãã¹ãã©ããã§clangã®APIã使ã£ã¦ãã¼ã¹ãã¦ã¹ã¿ããçæããã³ã¼ãããæããã¨ã解æãã¦ãã¹ã¿ããèªåã§æ¸ããã¨ã§å¯¾å¿ãéå§ããã
26:00
ã¬ã¹ãã³ã¹ãæ¸ãåºããã«ãã¤ã³ããã·ã¼ã¸ã£ãä½ãã«ã¯ãVMçææã«æ¸¡ãããrequest_recãããã·ã¼ã¸ã£ã®æèã§åå¾ã§ããªããã°ãªããªãããããããã¨ã³ããªãã¤ã³ãã¯ãã¹ã¿ãã£ãã¯ã¡ã½ããã§ããã
VMãããã«ãã¤ã³ã¢ã¸ã¥ã¼ã«åãæå®ãã¦ã¢ã¸ã¥ã¼ã«ãåå¾ã§ããããªãã¨ãåãã£ãã®ã§ããã®æ¹æ³ã調ã¹ãã
27:10
vm/vm/main
é
ä¸ã®VMå
é¨ã®å®è£
ãèªã¿è§£ããããããã¢ã¸ã¥ã¼ã«ãåå¾ãã¦ãã³ã³ããã¹ãã¯åããªãã®ã§ã代ããã«ãã«ãã¤ã³ããã·ã¼ã¸ã£ã®ã¹ã¿ããã®ãã®ã¸ã®ãã¤ã³ã¿ãåå¾ããæ¹æ³ãããªããã¨ãå¤æããã
27:40
Apache.Rputs
ã®å®è£
ãã§ãããã©ã¦ã¶ã«æåãåºåãããã¨ã«æåãããç²å¼ããã£ããã風åã«å
¥ãã
28:00
1æéã»ã©ã®ä»®ç ã試ã¿ããã4æéå¯ã¦ãã¾ãã
32:00
Ozã§ä½ããããã決ãããã¨ãããI/Oã¹ã¬ãããç¬ç«ãã¦ãããã¨ããããããæ£ããåãã¦ãããã¨ã確èªããããã®ã³ã¼ããæ¸ããããããããã®ã¾ã¾ãã¿ã«ãããã¨ã«ããã
32:10
TCPã§ã®éä¿¡ã®æ¹æ³ã調ã¹ã¯ããããã¨ããããApacheã®æèããå¤ãã¦ãOzã§ã¹ã¿ã³ãã¢ãã³ã§éä¿¡ãããã³ã¼ããæ¸ãããµã¼ãã¼å´ã¯Goã§å®è£ ããã
33:10
Goã§å®è£ ãããµã¼ãã¼ã¨ã®éä¿¡ã«æåããã
33:20
éä¿¡ããå 容ãApacheãéãã¦ã¬ã¹ãã³ã¹ã¨ãã¦è¿ããã¨ã«æåããã ãã¿ãä»è¾¼ãããã®å®è£ ãå§ãããããOzã®æ¨æºã¢ã¸ã¥ã¼ã«ã«ã¤ãã¦ãããã調ã¹å§ããã
33:40
ã¡ãã£ã¨ããéã³ãå®è£
ãããããApache.Rflush
ã®å®è£
ãããã
34:10
éãã¦åãããã«ãªããã¬ãã¸ããªãä½æãã¦ãpushã
34:54
ã¢ããã³ãã«ã¬ã³ãã¼ãå®å ¨ã«ãã¹ãã ã£ã
— moriyoshit (@moriyoshit) December 5, 2016
æå¾ã«
ãã§ããã